Class::Meta::Method - Class::Meta class method introspection
# Assuming MyApp::Thingy was generated by Class::Meta. my $class = MyApp::Thingy->class; my $thingy = MyApp::Thingy->new; print "\nMethods:\n"; for my $meth ($class->methods) { print " o ", $meth->name, $/; $meth->call($thingy); }
This class provides an interface to the Class::Meta objects that describe methods. It supports a simple description of the method, a label, and its visibility (private, protected, or public).
Class::Meta
Class::Meta::Method objects are created by Class::Meta; they are never instantiated directly in client code. To access the method objects for a Class::Meta-generated class, simply call its class method to retrieve its Class::Meta::Class object, and then call the methods() method on the Class::Meta::Class object.
class
methods()
my $name = $meth->name;
Returns the method name.
my $package = $meth->package;
Returns the method package.
my $desc = $meth->desc;
Returns the description of the method.
my $desc = $meth->label;
Returns label for the method.
my $view = $meth->view;
Returns the view of the method, reflecting its visibility. The possible values are defined by the following constants:
my $context = $meth->context;
Returns the context of the method, essentially whether it is a class or object method. The possible values are defined by the following constants:
my $ret = $meth->call($obj, @args);
Calls the method on the $obj object, passing in any arguments.
$obj
This file was packaged with the Class-Meta-0.11 distribution.
Please report all bugs via the CPAN Request Tracker at http://rt.cpan.org/NoAuth/Bugs.html?Dist=Class-Meta.
David Wheeler <david@kineticode.com>
Other classes of interest within the Class::Meta distribution include:
Copyright (c) 2002-2004, David Wheeler. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Class::Meta, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Class::Meta
CPAN shell
perl -MCPAN -e shell install Class::Meta
For more information on module installation, please visit the detailed CPAN module installation guide.