X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse%2FRole.pm;h=8a68ad6020fc0f6245efa79af9cca594e41a466f;hp=9717fdaf25541643e0bbb6315c5e2dfec13be2ef;hb=c2168931940aa681120ba25c60658fe33c42cc1d;hpb=4c0fe06fa87e7c2c4ed1666e77ed52ae020f19d7 diff --git a/lib/Mouse/Role.pm b/lib/Mouse/Role.pm index 9717fda..8a68ad6 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.41'; +our $VERSION = '0.50_04'; 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.41 +This document describes Mouse version 0.50_04 =head1 SYNOPSIS @@ -161,15 +158,15 @@ This document describes Mouse version 0.41 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. -=head2 C<< after (method|methods) => CodeRef >> +=head2 C<< after (method|methods|regexp) => CodeRef >> 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.