From: Jesse Luehrs Date: Thu, 23 Sep 2010 07:48:07 +0000 (-0500) Subject: make this a bit more extensible, for moose's benefit X-Git-Tag: 1.09~16 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fdea04e89892cf7f8bfc5287ac46506e0145a062;p=gitmo%2FClass-MOP.git make this a bit more extensible, for moose's benefit --- diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index 334c57f..1afc676 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -125,13 +125,15 @@ sub _real_ref_name { : ref $self; } +sub _meta_method_class { 'Class::MOP::Method::Meta' } + sub _add_meta_method { my $self = shift; my $existing_method = $self->find_method_by_name('meta'); return if $existing_method - && $existing_method->isa('Class::MOP::Method::Meta'); + && $existing_method->isa($self->_meta_method_class); $self->add_method( - 'meta' => Class::MOP::Method::Meta->wrap( + 'meta' => $self->_meta_method_class->wrap( name => 'meta', package_name => $self->name, associated_metaclass => $self, diff --git a/t/010_self_introspection.t b/t/010_self_introspection.t index 93ac3c5..dbf5c4e 100644 --- a/t/010_self_introspection.t +++ b/t/010_self_introspection.t @@ -93,7 +93,7 @@ my @class_mop_class_methods = qw( find_method_by_name find_all_methods_by_name find_next_method_by_name add_before_method_modifier add_after_method_modifier add_around_method_modifier - _add_meta_method + _add_meta_method _meta_method_class _attach_attribute _post_add_attribute