Class::MOP::Overload - Overload Meta Object |
new(%options)
Class::MOP::Overload - Overload Meta Object
version 2.1605
my $meta = Class->meta; my $overload = $meta->get_overloaded_operator('+');
if ( $overload->has_method_name ) { print 'Method for + is ', $overload->method_name, "\n"; } else { print 'Overloading for + is implemented by ', $overload->coderef_name, " sub\n"; }
This class provides meta information for overloading in classes and roles.
Class::MOP::Overload
is a subclass of the Class::MOP::Object manpage.
new(%options)
This method creates a new Class::MOP::Overload
object. It accepts a number
of options:
""
or +
. This is required.
Either this or the coderef
option must be passed.
This is optional.
Either this or the method_name
option must be passed.
This is required if coderef
is passed.
This is required if coderef
is passed.
This is optional.
Returns the operator for this overload object.
Returns the method name that implements overloading, if it has one.
Returns true if the object has a method name.
Returns the the Class::MOP::Method manpage that implements overloading, if it has one.
Returns true if the object has a method.
Returns the coderef that implements overloading, if it has one.
Returns true if the object has a coderef.
Returns the package for the coderef that implements overloading, if it has one.
Returns true if the object has a coderef package.
Returns the sub name for the coderef that implements overloading, if it has one.
Returns true if the object has a coderef name.
Returns true if the overloading is implemented by an anonymous coderef.
Returns the the Class::MOP::Module manpage (class or role) that is associated with the overload object.
Clones the overloading object, setting original_overload
in the process.
For cloned objects, this returns the the Class::MOP::Overload manpage object from which they were cloned. This can be used to determine the source of an overloading in a class that came from a role, for example.
This software is copyright (c) 2006 by Infinity Interactive, Inc.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Class::MOP::Overload - Overload Meta Object |