X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FRole.pm;h=79f3b7fc697070fb99d277a3a06a69d4ce6251f7;hb=fc0e0bbda277a99354170a4b8de6eb1275920555;hp=0c04b7421018a54dca10a3f0355b1289c7ffbd1f;hpb=c2f128e7c8795ef8115bbfe99aae1f19960903e8;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Role.pm b/lib/Mouse/Meta/Role.pm index 0c04b74..79f3b7f 100644 --- a/lib/Mouse/Meta/Role.pm +++ b/lib/Mouse/Meta/Role.pm @@ -58,6 +58,13 @@ sub apply { for my $modifier_type (qw/before after around/) { no strict 'refs'; + *{ __PACKAGE__ . '::' . "add_${modifier_type}_method_modifier" } = sub { + my ($self, $method_name, $method) = @_; + + push @{ $self->{"${modifier_type}_method_modifiers"}->{$method_name} }, + $method; + }; + *{ __PACKAGE__ . '::' . "get_${modifier_type}_method_modifiers" } = sub { my ($self, $method_name, $method) = @_; @{ $self->{"${modifier_type}_method_modifiers"}->{$method_name} || [] }