X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse%2FRole.pm;h=511a4e56cdb87617cdf9f0db6a5f03b364edf3b6;hp=56b90b7a5017a6bd0bded74dafc3e09f9ca50d12;hb=013ee5f0c0ce5afa1fea9d45bd14bd8f8bfd67f4;hpb=9ee0e57c8c1ca23a9de421bf3ecf9e73ba795898 diff --git a/lib/Mouse/Role.pm b/lib/Mouse/Role.pm index 56b90b7..511a4e5 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_08'; +our $VERSION = '0.50'; use Carp qw(confess); use Scalar::Util qw(blessed); @@ -49,37 +49,34 @@ sub has { } } else{ # has foo => (...) - $meta->add_attribute($_ => @_); + $meta->add_attribute($name => @_); } return; } 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_08 +This document describes Mouse version 0.50 =head1 SYNOPSIS @@ -163,18 +160,15 @@ Returns this role's metaclass instance. =head2 C<< before (method|methods) -> 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 >> -Sets up an B method modifier. See L or -L. +Sets up an B method modifier. See L. =head2 C<< around (method|methods) => CodeRef >> -Sets up an B method modifier. See L or -L. +Sets up an B method modifier. See L. =head2 C