X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FRole.pm;h=90608ca22e907b0c7a39442490d9e8d857ea6852;hb=0ffc4183de68b15deeec5d662d9cc1d125dabf26;hp=e8737bf62c759beff7cc5a2d37bda9f4982c1b8d;hpb=506fb74dbff3e8f756230c643d8bff7b85ae9ca3;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Role.pm b/lib/Mouse/Role.pm index e8737bf..90608ca 100644 --- a/lib/Mouse/Role.pm +++ b/lib/Mouse/Role.pm @@ -1,7 +1,7 @@ package Mouse::Role; use Mouse::Exporter; # enables strict and warnings -our $VERSION = '0.40_09'; +our $VERSION = '0.50_03'; use Carp qw(confess); use Scalar::Util qw(blessed); @@ -56,30 +56,27 @@ sub has { sub before { my $meta = Mouse::Meta::Role->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::Role->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::Role->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; } @@ -148,7 +145,7 @@ Mouse::Role - The Mouse Role =head1 VERSION -This document describes Mouse version 0.40_09 +This document describes Mouse version 0.50_03 =head1 SYNOPSIS @@ -161,20 +158,17 @@ This document describes Mouse version 0.40_09 Returns this role's metaclass instance. -=head2 C<< before (method|methods) -> CodeRef >> +=head2 C<< before (method|methods|regexp) -> CodeRef >> -Sets up a B method modifier. See L or -L. +Sets up a B method modifier. See L. -=head2 C<< after (method|methods) => CodeRef >> +=head2 C<< after (method|methods|regexp) => CodeRef >> -Sets up an B method modifier. See L or -L. +Sets up an B method modifier. See L. -=head2 C<< around (method|methods) => CodeRef >> +=head2 C<< around (method|methods|regexp) => CodeRef >> -Sets up an B method modifier. See L or -L. +Sets up an B method modifier. See L. =head2 C