clean up implements implementation by providing an add_method_to_target method in...
[catagits/Reaction.git] / lib / Reaction / Class.pm
index b3cf253..7813f48 100644 (file)
@@ -168,7 +168,7 @@ sub setup_and_cleanup {
   eval "package ${package}; no $unimport_class;";
   confess "$unimport_class unimport from ${package} failed: $@" if $@;
   foreach my $m (@methods) {
-    $package->meta->add_method(@$m);
+    $self->add_method_to_target($package, $m);
   }
   foreach my $a (@apply_after) {
     my $call = shift(@$a);
@@ -176,6 +176,11 @@ sub setup_and_cleanup {
   }
 }
 
+sub add_method_to_target {
+  my ($self, $target, $method) = @_;
+  $target->meta->add_method(@$method);
+}
+
 sub delayed_methods {
   return (qw/has with extends before after around override augment/);
 }