Refinements::Package - a package of refinements
Refinements will make your package inherit from this package. This package itself is a subclass of Method::Lexical.
The following class methods are defined:
add_refinement($fqname, $coderef)
Adds a refinement to your package.
$fqname should be a fully-qualified sub name; the method which you wish to override; such as "LWP::UserAgent::request" or "UNIVERSAL::DOES".
$fqname
"LWP::UserAgent::request"
"UNIVERSAL::DOES"
$coderef is the new implementation for the method. Note that, like Moose around method modifiers, it gets passed a coderef for the original method as its first argument. Unlike Moose, this may sometimes be undef (if your refinement is defining a new method which does not already exist).
$coderef
around
undef
has_refinement($fqname)
Returns a boolean indicating whether the package has a refinement.
get_refinement($fqname)
Returns the refinement coderef for the name.
get_refinement_names()
Returns the fully-qualified names of all refinements in the package, in no particular order.
import()
The glue for Method::Lexical.
Please report any bugs to http://rt.cpan.org/Dist/Display.html?Queue=Refinements.
Refinements, Method::Lexical.
Toby Inkster <tobyink@cpan.org>.
This software is copyright (c) 2013 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
To install Refinements, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Refinements
CPAN shell
perl -MCPAN -e shell install Refinements
For more information on module installation, please visit the detailed CPAN module installation guide.