my $attrs = ref $name eq 'ARRAY' ? $name : [$name];
- Class::MOP::Class
- ->initialize($caller)
+ Class::MOP::class_of($caller)
->add_class_attribute( $_, %options )
for @{ $attrs };
}
my $self = shift;
my %attrs =
- map { my $meta = Class::MOP::Class->initialize($_);
- $meta->can('get_class_attribute_map')
+ map { my $meta = Class::MOP::class_of($_);
+ $meta && $meta->can('get_class_attribute_map')
? %{ $meta->get_class_attribute_map() }
: ()
}
foreach my $class ( $self->linearized_isa() )
{
- my $meta = Class::MOP::Class->initialize($class);
+ my $meta = Class::MOP::class_of($class)
+ or next;
return $meta->get_class_attribute($name)
if $meta->can('has_class_attribute') && $meta->has_class_attribute($name);