1 package MooseX::Declare::Syntax::Keyword::MethodModifier;
5 use Moose::Util::TypeConstraints;
7 use namespace::clean -except => 'meta';
9 with 'MooseX::Declare::Syntax::MethodDeclaration';
11 has modifier_type => (
13 isa => enum(undef, qw( around after before override augment )),
17 sub register_method_declaration {
18 my ($self, $meta, $name, $method) = @_;
19 return Moose::Util::add_method_modifier($meta->name, $self->modifier_type, [$name, $method->body]);
28 MooseX::Declare::Syntax::Keyword::MethodModifier - Handle method modifier declarations
32 Allows the implementation of method modification handlers like C<around> and
39 =item * L<MooseX::Declare::Syntax::MethodDeclaration>
47 A required string that is one of:
57 =head2 register_method_declaration
59 Object->register_method_declaration (Object $metaclass, Str $name, Object $method)
61 This will add the method modifier to the C<$metaclass> via L<Moose::Util>s
62 C<add_method_modifier>, whose return value will also be returned from this
69 =item * L<MooseX::Declare>
71 =item * L<MooseX::Declare::Syntax::MooseSetup>
73 =item * L<MooseX::Declare::Syntax::MethodDeclaration>
75 =item * L<MooseX::Method::Signatures>
79 =head1 AUTHOR, COPYRIGHT & LICENSE
81 See L<MooseX::Declare>