Acme-Has-Tiny
view release on metacpan or search on metacpan
);
...; # other stuff here
return $self;
}
Constants
`CAN_HAZ_XS`
Whether Class::XSAccessor can be used.
CAVEATS
Inheriting attributes from parent classes is not super well-tested.
BUGS
Please report any bugs to
<http://rt.cpan.org/Dist/Display.html?Queue=Acme-Type-Tiny>.
SEE ALSO
Moo, Moose, Mouse.
AUTHOR
Toby Inkster <tobyink@cpan.org>.
lib/Acme/Has/Tiny.pm view on Meta::CPAN
return;
}
sub assert_valid
{
my $me = shift;
my ($class, $hash) = @_;
my @validator = map {
$VALIDATORS{$_} ||= $me->_compile_validator($_, $ATTRIBUTES{$_});
} $me->_find_parents($class);
$_->($hash) for @validator;
return $hash;
}
my $default_buildargs = sub
{
my $class = shift;
return +{
(@_ == 1 && ref($_[0]) eq q(HASH)) ? %{$_[0]} : @_
lib/Acme/Has/Tiny.pm view on Meta::CPAN
sprintf('if (exists($self->{%s})) {', $a),
sprintf('$Acme::Has::Tiny::ATTRIBUTES{%s}{%s}{isa}->($self->{%s});', map perlstring($_), $class, $a, $a),
'}',
);
}
}
return @code;
}
sub _find_parents
{
my $me = shift;
my $class = $_[0];
if (eval { require mro } or eval { require MRO::Compat })
{
return @{ mro::get_linear_isa($class) };
}
require Class::ISA;
lib/Acme/Has/Tiny.pm view on Meta::CPAN
=over
=item C<< CAN_HAZ_XS >>
Whether Class::XSAccessor can be used.
=back
=head1 CAVEATS
Inheriting attributes from parent classes is not super well-tested.
=head1 BUGS
Please report any bugs to
L<http://rt.cpan.org/Dist/Display.html?Queue=Acme-Type-Tiny>.
=head1 SEE ALSO
L<Moo>, L<Moose>, L<Mouse>.
( run in 0.248 second using v1.01-cache-2.11-cpan-4d50c553e7e )