Add get_before_method_modifiers etc
[gitmo/Mouse.git] / lib / Mouse / Meta / Role.pm
index f4bf289..0c04b74 100644 (file)
@@ -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;