1 package MooseX::Declare::Syntax::Keyword::Method;
5 use namespace::clean -except => 'meta';
7 with 'MooseX::Declare::Syntax::MethodDeclaration';
9 sub register_method_declaration {
10 my ($self, $meta, $name, $method) = @_;
11 return $meta->add_method($name, $method);
20 MooseX::Declare::Syntax::Keyword::Method - Handle method declarations
24 This role is an extension of L<MooseX::Declare::Syntax::MethodDeclaration>
25 that allows you to install keywords that declare methods.
31 =item * L<MooseX::Declare::Syntax::MethodDeclaration>
37 =head2 register_method_declaration
39 Object->register_method_declaration (Object $metaclass, Str $name, Object $method)
41 This method required by the method declaration role will register the finished
42 method object via the C<< $metaclass->add_method >> method.
45 identifier => 'around',
46 modifier_type => 'around',
47 prototype_injections => {
48 declarator => 'around',
49 injections => [ 'CodeRef $orig' ],
53 This will mean that the signature C<(Str $foo)> will become
54 C<CodeRef $orig: Object $self, Str $foo> and and C<()> will become
55 C<CodeRef $orig: Object $self>.
61 =item * L<MooseX::Declare>
63 =item * L<MooseX::Declare::Syntax::MooseSetup>
65 =item * L<MooseX::Declare::Syntax::MethodDeclaration>
67 =item * L<MooseX::Method::Signatures>
71 =head1 AUTHOR, COPYRIGHT & LICENSE
73 See L<MooseX::Declare>