- Introduce Moo::HandleMoose, which should allow Moo classes and roles
- to be treated as Moose classes/roles
+ to be treated as Moose classes/roles. Supported so far:
+ - Some level of attributes and methods for both classes and roles
+ - Required methods in roles
0.009014 - 2012-03-29
- Split Role::Tiny out into its own dist
my %methods = %{Role::Tiny->_concrete_methods_of($name)};
my @attrs;
{
+ # This local is completely not required for roles but harmless
local @{_getstash($name)}{keys %methods};
foreach my $name (keys %$attr_specs) {
- push @attrs, $meta->add_attribute($name => %{$attr_specs->{$name}});
+ my %spec = %{$attr_specs->{$name}};
+ $spec{is} = 'ro' if $spec{is} eq 'lazy';
+ push @attrs, $meta->add_attribute($name => %spec);
}
}
- unless ($am_role) {
+ if ($am_role) {
+ $meta->add_required_methods(@{$Moo::Role::INFO{$name}{requires}});
+ } else {
foreach my $attr (@attrs) {
foreach my $method (@{$attr->associated_methods}) {
$method->{body} = $name->can($method->name);