package MooseX::Declare::Syntax::Keyword::Method; BEGIN { $MooseX::Declare::Syntax::Keyword::Method::AUTHORITY = 'cpan:FLORA'; } { $MooseX::Declare::Syntax::Keyword::Method::VERSION = '0.35'; } # ABSTRACT: Handle method declarations use Moose; use namespace::clean -except => 'meta'; with 'MooseX::Declare::Syntax::MethodDeclaration'; sub register_method_declaration { my ($self, $meta, $name, $method) = @_; return $meta->add_method($name, $method); } 1; __END__ =pod =encoding utf-8 =head1 NAME MooseX::Declare::Syntax::Keyword::Method - Handle method declarations =head1 DESCRIPTION This role is an extension of L that allows you to install keywords that declare methods. =head1 METHODS =head2 register_method_declaration Object->register_method_declaration (Object $metaclass, Str $name, Object $method) This method required by the method declaration role will register the finished method object via the C<< $metaclass->add_method >> method. MethodModifier->new( identifier => 'around', modifier_type => 'around', prototype_injections => { declarator => 'around', injections => [ 'CodeRef $orig' ], }, ); This will mean that the signature C<(Str $foo)> will become C and and C<()> will become C. =head1 CONSUMES =over 4 =item * L =back =head1 SEE ALSO =over 4 =item * L =item * L =item * L =item * L =back =head1 AUTHORS =over 4 =item * Florian Ragwitz =item * Ash Berlin =item * Chas. J. Owens IV =item * Chris Prather =item * Dave Rolsky =item * Devin Austin =item * Hans Dieter Pearcey =item * Justin Hunter =item * Matt Kraai =item * Michele Beltrame =item * Nelo Onyiah =item * nperez =item * Piers Cawley =item * Rafael Kitover =item * Robert 'phaylon' Sedlacek =item * Stevan Little =item * Tomas Doran =item * Yanick Champoux =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2011 by Florian Ragwitz. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut