The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Class::MOP::Method - Method Meta Object

DESCRIPTION

The Method Protocol is very small, since methods in Perl 5 are just subroutines within the particular package. We provide a very basic introspection interface.

METHODS

Introspection

meta

This will return a Class::MOP::Class instance which is related to this class.

Construction

wrap ($code, %params)

This is the basic constructor, it returns a Class::MOP::Method instance which wraps the given $code reference. You must also set the package_name and name attributes in %params.

clone (%params)

This will make a copy of the object, allowing you to override any values by stuffing them in %params.

Informational

body

This returns the actual CODE reference of the particular instance.

name

This returns the name of the CODE reference.

associated_metaclass

The metaclass of the method

package_name

This returns the package name that the CODE reference is attached to.

fully_qualified_name

This returns the fully qualified name of the CODE reference.

original_method

If this method object was created as a clone of some other method object, this returns the object that was cloned.

original_name

This returns the original name of the CODE reference, wherever it was first defined.

If this method is a clone of a clone (of a clone, etc.), this method returns the name from the first method in the chain of clones.

original_package_name

This returns the original package name that the CODE reference is attached to, wherever it was first defined.

If this method is a clone of a clone (of a clone, etc.), this method returns the package name from the first method in the chain of clones.

original_fully_qualified_name

This returns the original fully qualified name of the CODE reference, wherever it was first defined.

If this method is a clone of a clone (of a clone, etc.), this method returns the fully qualified name from the first method in the chain of clones.

Metaclass

attach_to_class

Sets the associated metaclass

detach_from_class

Disassociates the method from the metaclass

Miscellaneous

execute

Executes the method. Be sure to pass in the instance, since the method expects it.

AUTHORS

Stevan Little <stevan@iinteractive.com>

COPYRIGHT AND LICENSE

Copyright 2006-2008 by Infinity Interactive, Inc.

http://www.iinteractive.com

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.