foreach my $class ( $self->linearized_isa ) {
# fetch the meta-class ...
- my $meta = $self->initialize($class);
+ my $meta = Class::MOP::Class->initialize($class);
return $meta->get_attribute($attr_name)
if $meta->has_attribute($attr_name);
}
sub get_all_attributes {
my $self = shift;
- my %attrs = map { %{ $self->initialize($_)->_attribute_map } }
+ my %attrs = map { %{ Class::MOP::Class->initialize($_)->_attribute_map } }
reverse $self->linearized_isa;
return values %attrs;
}
return (
$name,
map {
- $self->initialize($_)->class_precedence_list()
+ Class::MOP::Class->initialize($_)->class_precedence_list()
} $self->superclasses()
);
}
(defined $method_name && length $method_name)
|| confess "You must define a method name to find";
foreach my $class ($self->linearized_isa) {
- my $method = $self->initialize($class)->get_method($method_name);
+ my $method = Class::MOP::Class->initialize($class)->get_method($method_name);
return $method if defined $method;
}
return;
my %methods;
for my $class ( reverse $self->linearized_isa ) {
- my $meta = $self->initialize($class);
+ my $meta = Class::MOP::Class->initialize($class);
$methods{$_} = $meta->get_method($_)
for $meta->get_method_list;
sub get_all_method_names {
my $self = shift;
my %uniq;
- return grep { !$uniq{$_}++ } map { $self->initialize($_)->get_method_list } $self->linearized_isa;
+ return grep { !$uniq{$_}++ } map { Class::MOP::Class->initialize($_)->get_method_list } $self->linearized_isa;
}
sub find_all_methods_by_name {
my @methods;
foreach my $class ($self->linearized_isa) {
# fetch the meta-class ...
- my $meta = $self->initialize($class);
+ my $meta = Class::MOP::Class->initialize($class);
push @methods => {
name => $method_name,
class => $class,
my @cpl = $self->linearized_isa;
shift @cpl; # discard ourselves
foreach my $class (@cpl) {
- my $method = $self->initialize($class)->get_method($method_name);
+ my $method = Class::MOP::Class->initialize($class)->get_method($method_name);
return $method if defined $method;
}
return;