X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FClass%2FMOP%2FMixin%2FHasMethods.pm;h=bd28e4021ebe9a0f2faff60d5f575c425bda2357;hb=78902d1df967dfe480294acbeb65e2e2bae4439e;hp=50684a9706cbeb6582ea4f9f2f1db59472906773;hpb=5abcc7951c3ee97e7cfc915641fe3ecca3218749;p=gitmo%2FClass-MOP.git diff --git a/lib/Class/MOP/Mixin/HasMethods.pm b/lib/Class/MOP/Mixin/HasMethods.pm index 50684a9..bd28e40 100644 --- a/lib/Class/MOP/Mixin/HasMethods.pm +++ b/lib/Class/MOP/Mixin/HasMethods.pm @@ -189,6 +189,16 @@ sub _get_local_methods { keys %{$namespace}; } +sub _restore_metamethods_from { + my $self = shift; + my ($old_meta) = @_; + + for my $method ($old_meta->_get_local_methods) { + $method->_make_compatible_with($self->method_metaclass); + $self->add_method($method->name => $method); + } +} + 1; __END__