Acme-Mitey-Cards
view release on metacpan or search on metacpan
lib/Acme/Mitey/Cards/Card/Face.pm.mite.pm view on Meta::CPAN
or croak "Type check failed in constructor: %s should be %s", "face",
"Character";
$self->{"face"} = $args->{"face"};
# Call BUILD methods
$self->BUILDALL($args) if ( !$no_build and @{ $meta->{BUILD} || [] } );
# Unrecognized parameters
my @unknown = grep not(/\A(?:deck|face|reverse|suit)\z/), keys %{$args};
@unknown
and croak(
"Unexpected keys in constructor: " . join( q[, ], sort @unknown ) );
return $self;
}
my $__XS = !$ENV{PERL_ONLY}
&& eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") };
# Accessors for face
# has declaration, file lib/Acme/Mitey/Cards/Card/Face.pm, line 20
if ($__XS) {
Class::XSAccessor->import(
chained => 1,
"getters" => { "face" => "face" },
);
}
else {
*face = sub {
@_ == 1 or croak('Reader "face" usage: $self->face()');
$_[0]{"face"};
};
}
# Accessors for suit
# has declaration, file lib/Acme/Mitey/Cards/Card/Face.pm, line 13
if ($__XS) {
Class::XSAccessor->import(
chained => 1,
"getters" => { "suit" => "suit" },
);
}
else {
*suit = sub {
@_ == 1 or croak('Reader "suit" usage: $self->suit()');
$_[0]{"suit"};
};
}
# See UNIVERSAL
sub DOES {
my ( $self, $role ) = @_;
our %DOES;
return $DOES{$role} if exists $DOES{$role};
return 1 if $role eq __PACKAGE__;
if ( $INC{'Moose/Util.pm'}
and my $meta = Moose::Util::find_meta( ref $self or $self ) )
{
$meta->can('does_role') and $meta->does_role($role) and return 1;
}
return $self->SUPER::DOES($role);
}
# Alias for Moose/Moo-compatibility
sub does {
shift->DOES(@_);
}
# Method signatures
our %SIGNATURE_FOR;
$SIGNATURE_FOR{"face_abbreviation"} = sub {
my $__NEXT__ = shift;
my ( %tmp, $tmp, @head );
@_ == 1
or
croak( "Wrong number of parameters in signature for %s: got %d, %s",
"face_abbreviation", scalar(@_), "expected exactly 1 parameters" );
@head = splice( @_, 0, 1 );
# Parameter invocant (type: Defined)
( defined( $head[0] ) )
or croak(
"Type check failed in signature for face_abbreviation: %s should be %s",
"\$_[0]", "Defined"
);
do { @_ = ( @head, @_ ); goto $__NEXT__ };
};
$SIGNATURE_FOR{"to_string"} =
$Acme::Mitey::Cards::Card::SIGNATURE_FOR{"to_string"};
1;
}
( run in 1.116 second using v1.01-cache-2.11-cpan-800906f7e73 )