}
}
+sub _method_lookup_order {
+ return (shift->linearized_isa, 'UNIVERSAL');
+}
+
## Methods
{
my ($self, $method_name) = @_;
(defined $method_name && length $method_name)
|| confess "You must define a method name to find";
- foreach my $class ($self->linearized_isa, 'UNIVERSAL') {
+ foreach my $class ($self->_method_lookup_order) {
my $method = Class::MOP::Class->initialize($class)->get_method($method_name);
return $method if defined $method;
}
my $self = shift;
my %methods;
- for my $class ( 'UNIVERSAL', reverse $self->linearized_isa ) {
+ for my $class ( reverse $self->_method_lookup_order ) {
my $meta = Class::MOP::Class->initialize($class);
$methods{ $_->name } = $_ for $meta->_get_local_methods;
(defined $method_name && length $method_name)
|| confess "You must define a method name to find";
my @methods;
- foreach my $class ($self->linearized_isa, 'UNIVERSAL') {
+ foreach my $class ($self->_method_lookup_order) {
# fetch the meta-class ...
my $meta = Class::MOP::Class->initialize($class);
push @methods => {
my ($self, $method_name) = @_;
(defined $method_name && length $method_name)
|| confess "You must define a method name to find";
- my @cpl = ($self->linearized_isa, 'UNIVERSAL');
+ my @cpl = ($self->_method_lookup_order);
shift @cpl; # discard ourselves
foreach my $class (@cpl) {
my $method = Class::MOP::Class->initialize($class)->get_method($method_name);