X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse.pm;h=a170114960b4b8e2d0bbbc6ff5aae5a73eb49f78;hp=fcb9976d1e870a66cdbea6ceb3a682b8c37abf21;hb=b0b9f25a58185affc1f7a005929bf6b3f8770160;hpb=e9148d131f7c3d6a1e3fc9e7c491f80fb5dde90b diff --git a/lib/Mouse.pm b/lib/Mouse.pm index fcb9976..a170114 100644 --- a/lib/Mouse.pm +++ b/lib/Mouse.pm @@ -61,33 +61,27 @@ sub has { sub before { my $meta = Mouse::Meta::Class->initialize(scalar caller); - my $code = pop; - - for (@_) { - $meta->add_before_method_modifier($_ => $code); + for my $name($meta->_collect_methods(@_)) { + $meta->add_before_method_modifier($name => $code); } return; } sub after { my $meta = Mouse::Meta::Class->initialize(scalar caller); - my $code = pop; - - for (@_) { - $meta->add_after_method_modifier($_ => $code); + for my $name($meta->_collect_methods(@_)) { + $meta->add_after_method_modifier($name => $code); } return; } sub around { my $meta = Mouse::Meta::Class->initialize(scalar caller); - my $code = pop; - - for (@_) { - $meta->add_around_method_modifier($_ => $code); + for my $name($meta->_collect_methods(@_)) { + $meta->add_around_method_modifier($name => $code); } return; } @@ -249,15 +243,15 @@ Returns this class' metaclass instance. Sets this class' superclasses. -=head2 C<< before (method|methods) => CodeRef >> +=head2 C<< before (method|methods|regexp) => CodeRef >> Installs a "before" method modifier. See L. -=head2 C<< after (method|methods) => CodeRef >> +=head2 C<< after (method|methods|regexp) => CodeRef >> Installs an "after" method modifier. See L. -=head2 C<< around (method|methods) => CodeRef >> +=head2 C<< around (method|methods|regexp) => CodeRef >> Installs an "around" method modifier. See L.