From: Dave Rolsky Date: Tue, 17 Mar 2009 16:30:31 +0000 (-0500) Subject: Docs for CMOP::Method::Wrapped X-Git-Tag: 0.78_01~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=07ba54f850ad1c062bf1e3402de44a43240b1d26;p=gitmo%2FClass-MOP.git Docs for CMOP::Method::Wrapped --- diff --git a/lib/Class/MOP/Method/Wrapped.pm b/lib/Class/MOP/Method/Wrapped.pm index 32f22ea..04bb760 100644 --- a/lib/Class/MOP/Method/Wrapped.pm +++ b/lib/Class/MOP/Method/Wrapped.pm @@ -165,12 +165,12 @@ __END__ =head1 NAME -Class::MOP::Method::Wrapped - Method Meta Object to handle before/around/after modifiers +Class::MOP::Method::Wrapped - Method Meta Object for methods with before/after/around modifiers =head1 DESCRIPTION -This is a L subclass which provides the funtionality -to wrap a given CODE reference with before, after and around method modifiers. +This is a L subclass which implements before, +after, and around method modifiers. =head1 METHODS @@ -178,44 +178,54 @@ to wrap a given CODE reference with before, after and around method modifiers. =over 4 -=item B +=item B<< Class::MOP::Method::Wrapped->wrap($metamethod, %options) >> -This is the constructor, it will return a B -instance that can be used to add before, after and around modifiers to. +This is the constructor. It accepts a L object and +a hash of options. -=item B +The options are: -This returns the original CODE reference that was provided to the -constructor. - -=back +=over 8 -=head2 Modifiers +=item * name -These three methods will add the method modifiers to the wrapped -CODE reference. For more information on how method modifiers work, -see the section in L. +The method name (without a package name). This will be taken from the +provided L object if it is not provided. -=over 4 +=item * package_name -=item B +The package name for the method. This will be taken from the provided +L object if it is not provided. -=item B +=item * associated_metaclass -=item B +An optional L object. This is the metaclass for the +method's class. =back -These three methods each returna list of method modifiers I. +=item B<< $metamethod->get_original_method >> -=over 4 +This returns the L object that was passed to the +constructor. + +=item B<< $metamethod->add_before_modifier($code) >> + +=item B<< $metamethod->add_after_modifier($code) >> + +=item B<< $metamethod->add_around_modifier($code) >> + +These methods all take a subroutine reference and apply it as a +modifier to the original method. + +=item B<< $metamethod->before_modifiers >> -=item B +=item B<< $metamethod->after_modifiers >> -=item B +=item B<< $metamethod->around_modifiers >> -=item B +These methods all return a list of subroutine references which are +acting as the specified type of modifier. =back