From: Shawn M Moore Date: Wed, 30 Jul 2008 15:30:22 +0000 (+0000) Subject: Add get_before_method_modifiers etc X-Git-Tag: 0.19~228 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=commitdiff_plain;h=c2f128e7c8795ef8115bbfe99aae1f19960903e8 Add get_before_method_modifiers etc --- diff --git a/lib/Mouse/Meta/Role.pm b/lib/Mouse/Meta/Role.pm index f4bf289..0c04b74 100644 --- a/lib/Mouse/Meta/Role.pm +++ b/lib/Mouse/Meta/Role.pm @@ -56,5 +56,13 @@ sub apply { } } +for my $modifier_type (qw/before after around/) { + no strict 'refs'; + *{ __PACKAGE__ . '::' . "get_${modifier_type}_method_modifiers" } = sub { + my ($self, $method_name, $method) = @_; + @{ $self->{"${modifier_type}_method_modifiers"}->{$method_name} || [] } + }; +} + 1;