.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Object::InsideOut::Metadata 3pm" .TH Object::InsideOut::Metadata 3pm "2018-12-16" "perl v5.28.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Object::InsideOut::Metadata \- Introspection for Object::InsideOut classes .SH "VERSION" .IX Header "VERSION" This document describes Object::InsideOut::Metadata version 4.05 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& package My::Class; { \& use Object::InsideOut; \& use Object::InsideOut::Metadata; \& \& my @data :Field :Arg(\*(Aqdata\*(Aq) :Get(\*(Aqdata\*(Aq) :Set(\*(Aqput_data\*(Aq); \& my @misc :Field; \& \& my %init_args :InitArgs = ( \& \*(AqINFO\*(Aq => \*(Aq\*(Aq, \& ); \& \& sub _init :Init \& { \& my ($self, $args) = @_; \& if (exists($args\->{\*(AqINFO\*(Aq})) { \& $misc[$$self] = \*(AqINFO: \*(Aq . $args\->{\*(AqINFO\*(Aq}; \& } \& } \& \& sub misc :lvalue :Method \& { \& my $self = shift; \& $misc[$$self]; \& } \& add_meta(_\|_PACKAGE_\|_, \*(Aqmisc\*(Aq, { \*(Aqlvalue\*(Aq => 1 }); \& } \& \& package main; \& \& # Obtain a metadata object for a class \& my $meta = My::Class\->meta(); \& \& # ... or obtain a metadata object for an object \& my $obj = My::Class\->new(); \& my $meta = $obj\->meta(); \& \& # Obtain the class hierarchy from the metadata object \& my @classes = $meta\->get_classes(); \& \& # Obtain information on the parameters for a class\*(Aqs construction \& my %args = $meta\->get_args(); \& \& # Obtain information on a class\*(Aqs methods \& my %methods = $meta\->get_methods(); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Object::InsideOut provides an introspection \s-1API\s0 that allows you to obtain metadata on a class's hierarchy, constructor parameters, and methods. This is done through the use of metadata objects that are generated by this class. .PP In addition, developers can specify metadata data for methods they write for their classes. .SH "METADATA OBJECT" .IX Header "METADATA OBJECT" To obtain metadata on an Object::InsideOut class or object, you must first generate a metadata object for that class or object. Using that metadata object, one can then obtain information on the class hierarchy, constructor parameters, and methods. .ie n .IP "my $meta = My::Class\->\fBmeta()\fR;" 4 .el .IP "my \f(CW$meta\fR = My::Class\->\fBmeta()\fR;" 4 .IX Item "my $meta = My::Class->meta();" .PD 0 .ie n .IP "my $meta = $obj\->\fBmeta()\fR;" 4 .el .IP "my \f(CW$meta\fR = \f(CW$obj\fR\->\fBmeta()\fR;" 4 .IX Item "my $meta = $obj->meta();" .PD The \f(CW\*(C`\->meta()\*(C'\fR method, which is exported by Object::InsideOut to each class, returns an Object::InsideOut::Metadata object which can then be \&\fIqueried\fR for information about the invoking class or invoking object's class. .SH "CLASS HIERARCHY" .IX Header "CLASS HIERARCHY" Any Object::InsideOut class potentially has four categories of classes associated with it: .IP "1. Object::InsideOut" 4 .IX Item "1. Object::InsideOut" While the basis for all Object::InsideOut classes it is not an object class per se because you can create objects from it (i.e., you can't do \&\f(CW\*(C`Object::InsideOut\-\*(C'\fR\fBnew()\fR>). While \f(CW\*(C`My::Class\-\*(C'\fRisa('Object::InsideOut')> will return \fItrue\fR, because Object::InsideOut is not an object class, it is not considered to be part of a class's hierarchy. .IP "2. The class itself" 4 .IX Item "2. The class itself" A class's hierarchy always includes itself. .IP "3. Parent classes" 4 .IX Item "3. Parent classes" These are all the Object::InsideOut classes up the inheritance tree that a class is derived from. .IP "4. Foreign classes" 4 .IX Item "4. Foreign classes" These are non\-Object::InsideOut classes that a class inherits from. (See \&\*(L"\s-1FOREIGN CLASS INHERITANCE\*(R"\s0 in Object::InsideOut.) Because of implementation details, foreign classes do not appear in a class's \f(CW@ISA\fR array. However, Object::InsideOut implements a version of \f(CW\*(C`\->isa()\*(C'\fR that handles foreign classes. .PP A class's hierarchy consists of any classes in the latter three categories. .ie n .IP "$meta\->\fBget_classes()\fR;" 4 .el .IP "\f(CW$meta\fR\->\fBget_classes()\fR;" 4 .IX Item "$meta->get_classes();" When called in an array context, returns a list that constitutes the class hierarchy for the class or object used to generate the metadata object. When called in a scalar context, returns an array ref. .IP "My::Class\->\fBisa()\fR;" 4 .IX Item "My::Class->isa();" .PD 0 .ie n .IP "$obj\->\fBisa()\fR;" 4 .el .IP "\f(CW$obj\fR\->\fBisa()\fR;" 4 .IX Item "$obj->isa();" .PD When called in an array context, calling \f(CW\*(C`\->isa()\*(C'\fR without any arguments on an Object::InsideOut class or object returns a list of the classes in the class hierarchy for that class or object, and is equivalent to: .Sp .Vb 1 \& my @classes = $obj\->meta()\->get_classes(); .Ve .Sp When called in a scalar context, it returns an array ref containing the classes. .SH "CONSTRUCTOR PARAMETERS" .IX Header "CONSTRUCTOR PARAMETERS" Constructor parameters are the arguments given to a class's \f(CW\*(C`\->new()\*(C'\fR call. .ie n .IP "$meta\->\fBget_args()\fR;" 4 .el .IP "\f(CW$meta\fR\->\fBget_args()\fR;" 4 .IX Item "$meta->get_args();" Returns a hash (hash ref in scalar context) containing information on the parameters that can be used to construct an object from the class associated with the metadata object. Here's an example of such a hash: .Sp .Vb 10 \& { \& \*(AqMy::Class\*(Aq => { \& \*(Aqdata\*(Aq => { \& \*(Aqfield\*(Aq => 1, \& \*(Aqtype\*(Aq => \*(Aqnumeric\*(Aq, \& }, \& \*(Aqmisc\*(Aq => { \& \*(Aqmandatory\*(Aq => 1, \& }, \& }, \& \*(AqMy::Parent\*(Aq => { \& \*(Aqinfo\*(Aq => { \& \*(Aqdefault\*(Aq => \*(Aq\*(Aq, \& }, \& }, \& } .Ve .Sp The keys for this hash are the Object::IsideOut classes in the class hierarchy. These \fIclass keys\fR are paired with hash refs, the keys of which are the names of the parameters for that class (e.g., 'data' and 'misc' for My::Class, and 'info' for My::Parent). The hashes paired to the parameters contain information about the parameter: .RS 4 .IP "field" 4 .IX Item "field" The parameter corresponds directly to a class field, and is automatically processed during object creation. See \*(L"Field-Specific Parameters\*(R" in Object::InsideOut. .IP "mandatory" 4 .IX Item "mandatory" The parameter is required for object creation. See \*(L"Mandatory Parameters\*(R" in Object::InsideOut. .IP "default" 4 .IX Item "default" The default value assigned to the parameter if it is not found in the arguments to \f(CW\*(C`\->new()\*(C'\fR. See \*(L"Default Values\*(R" in Object::InsideOut. .IP "preproc" 4 .IX Item "preproc" The code ref for the subroutine that is used to \fIpreprocess\fR a parameter's value. See \*(L"Parameter Preprocessing\*(R" in Object::InsideOut .IP "type" 4 .IX Item "type" The form of type checking performed on the parameter. See \*(L"\s-1TYPE CHECKING\*(R"\s0 in Object::InsideOut for more details. .RS 4 .IP "'numeric'" 4 .IX Item "'numeric'" Parameter takes a numeric value as recognized by \&\fBScalar::Util::looks_like_number()\fR. .IP "'list'" 4 .IX Item "'list'" .PD 0 .IP "'list(_subtype_)'" 4 .IX Item "'list(_subtype_)'" .PD Parameter takes a single value (which is then placed in an array ref) or an array ref. .Sp When specified, the contents of the resulting array ref must be of the specified subtype: .RS 4 .IP "'numeric'" 4 .IX Item "'numeric'" Same as for the basic type above. .IP "A class name" 4 .IX Item "A class name" Same as for the basic type below. .IP "A reference type" 4 .IX Item "A reference type" Any reference type as returned by \fBref()\fR). .RE .RS 4 .RE .IP "'\s-1ARRAY\s0(_subtype_)'" 4 .IX Item "'ARRAY(_subtype_)'" Parameter takes an array ref with contents of the specified subtype as per the above. .IP "A class name" 4 .IX Item "A class name" Parameter takes an object of a specified class, or one of its sub-classes as recognized by \f(CW\*(C`\->isa()\*(C'\fR. .IP "Other reference type" 4 .IX Item "Other reference type" Parameter takes a reference of the specified type as returned by \&\fBref()\fR. .IP "A code ref" 4 .IX Item "A code ref" Parameter takes a value that is type-checked by the code ref paired to the \&'type' key. .RE .RS 4 .RE .RE .RS 4 .RE .SH "METHODS METADATA" .IX Header "METHODS METADATA" The methods returned by a metadata object are those that are currently available at the time of the \f(CW\*(C`\->get_methods()\*(C'\fR call. .PP The presence of \f(CW\*(C`:Automethod\*(C'\fR subroutines in an Object::InsideOut class, or \&\f(CW\*(C`AUTOLOAD\*(C'\fR in a foreign class means that the methods supported by the class may not be determinable. The presence of \f(CW\*(C`AUTOLOAD\*(C'\fR in the list of methods for a class should alert the programmer to the fact that more methods may be supported than are listed. .PP Methods that are excluded are private and hidden methods (see \&\*(L"\s-1PERMISSIONS\*(R"\s0 in Object::InsideOut), methods that begin with an underscore (which, by convention, means they are private), and subroutines named \&\f(CW\*(C`CLONE\*(C'\fR, \f(CW\*(C`CLONE_SKIP\*(C'\fR, and \f(CW\*(C`DESTROY\*(C'\fR (which are not methods). While technically a method, \f(CW\*(C`import\*(C'\fR is also excluded as it is generally not invoked directly (i.e., it's usually called as part of \f(CW\*(C`use\*(C'\fR). .ie n .IP "$meta\->\fBget_methods()\fR;" 4 .el .IP "\f(CW$meta\fR\->\fBget_methods()\fR;" 4 .IX Item "$meta->get_methods();" Returns a hash (hash ref in scalar context) containing information on the methods for the class associated with the metadata object. The keys in the hash are the method names. Paired to the names are hash refs containing metadata about the methods. Here's an example: .Sp .Vb 10 \& { \& # Methods exported by Object::InsideOut \& \*(Aqnew\*(Aq => { \& \*(Aqclass\*(Aq => \*(AqMy::Class\*(Aq, \& \*(Aqkind\*(Aq => \*(Aqconstructor\*(Aq \& }, \& \*(Aqclone\*(Aq => { \& \*(Aqclass\*(Aq => \*(AqMy::Class\*(Aq, \& \*(Aqkind\*(Aq => \*(Aqobject\*(Aq \& }, \& \*(Aqmeta\*(Aq => { \& \*(Aqclass\*(Aq => \*(AqMy::Class\*(Aq \& }, \& \*(Aqset\*(Aq => { \& \*(Aqclass\*(Aq => \*(AqMy::Class\*(Aq, \& \*(Aqkind\*(Aq => \*(Aqobject\*(Aq, \& \*(Aqrestricted\*(Aq => 1 \& }, \& # Methods provided by Object::InsideOut \& \*(Aqdump\*(Aq => { \& \*(Aqclass\*(Aq => \*(AqObject::InsideOut\*(Aq, \& \*(Aqkind\*(Aq => \*(Aqobject\*(Aq \& }, \& \*(Aqpump\*(Aq => { \& \*(Aqclass\*(Aq => \*(AqObject::InsideOut\*(Aq, \& \*(Aqkind\*(Aq => \*(Aqclass\*(Aq \& }, \& \*(Aqinherit\*(Aq => { \& \*(Aqclass\*(Aq => \*(AqObject::InsideOut\*(Aq, \& \*(Aqkind\*(Aq => \*(Aqobject\*(Aq, \& \*(Aqrestricted\*(Aq => 1 \& }, \& \*(Aqheritage\*(Aq => { \& \*(Aqclass\*(Aq => \*(AqObject::InsideOut\*(Aq, \& \*(Aqkind\*(Aq => \*(Aqobject\*(Aq, \& \*(Aqrestricted\*(Aq => 1 \& }, \& \*(Aqdisinherit\*(Aq => { \& \*(Aqclass\*(Aq => \*(AqObject::InsideOut\*(Aq, \& \*(Aqkind\*(Aq => \*(Aqobject\*(Aq, \& \*(Aqrestricted\*(Aq => 1 \& }, \& # Methods generated by Object::InsideOut for My::Class \& \*(Aqset_data\*(Aq => { \& \*(Aqclass\*(Aq => \*(AqMy::Class\*(Aq, \& \*(Aqkind\*(Aq => \*(Aqset\*(Aq, \& \*(Aqtype\*(Aq => \*(AqARRAY\*(Aq, \& \*(Aqreturn\*(Aq => \*(Aqnew\*(Aq \& }, \& \*(Aqget_data\*(Aq => { \& \*(Aqclass\*(Aq => \*(AqMy::Class\*(Aq, \& \*(Aqkind\*(Aq => \*(Aqget\*(Aq \& } \& # Class method provided by My::Class \& \*(Aqmy_method\*(Aq => { \& \*(Aqclass\*(Aq => \*(AqMy::Class\*(Aq, \& \*(Aqkind\*(Aq => \*(Aqclass\*(Aq \& } \& } .Ve .Sp Here are the method metadata that are provided: .RS 4 .IP "class" 4 .IX Item "class" The class in whose symbol table the method resides. The method may reside in the classes code, it may be exported by another class, or it may be generated by Object::InsideOut. .Sp Methods that are overridden in child classes are represented as being associated with the most junior class for which they appear. .IP "kind" 4 .IX Item "kind" Designation of the \fIcharacteristic\fR of the method: .RS 4 .IP "constructor" 4 .IX Item "constructor" The \f(CW\*(C`\->new()\*(C'\fR method, of course. .IP "get, set or accessor" 4 .IX Item "get, set or accessor" A \fIget\fR, \fIset\fR, or \fIcombined\fR accessor generated by Object::InsideOut. See \*(L"AcCESSOR \s-1GENERATION\*(R"\s0 in Object::InsideOut. .IP "cumulative, or cumulative (bottom up)" 4 .IX Item "cumulative, or cumulative (bottom up)" .PD 0 .IP "chained, or chained (bottom up)" 4 .IX Item "chained, or chained (bottom up)" .PD A cumulative or chained method. See \*(L"\s-1CUMULATIVE METHODS\*(R"\s0 in Object::InsideOut, and \*(L"\s-1CHAINED METHODS\*(R"\s0 in Object::InsideOut. The class associated with these methods is the most junior class in which they appears. .IP "class" 4 .IX Item "class" A method that is callable only on a class (e.g., \&\f(CW\*(C`My::Class\->my_method()\*(C'\fR). .IP "object" 4 .IX Item "object" A method that is callable only on a object (e.g. \f(CW\*(C`$obj\->get_data()\*(C'\fR). .IP "foreign" 4 .IX Item "foreign" A subroutine found in a foreign class's symbol table. Programmers must check the class's documentation to determine which are actually methods, and what kinds of methods they are. .IP "overload" 4 .IX Item "overload" A subroutine used for object coercion. These may be called as methods, but this is not normally how they are used. .IP "automethod" 4 .IX Item "automethod" Associated with an \s-1AUTOLOAD\s0 method for an Object::InsideOut class that implements an \f(CW\*(C`:Automethod\*(C'\fR subroutine. See \*(L"\s-1AUTOMETHODS\*(R"\s0 in Object::InsideOut. .RE .RS 4 .RE .IP "type" 4 .IX Item "type" The type checking that is done on arguments to \fIset/combined\fR accessors generated by Object::InsideOut. See \*(L"\s-1TYPE CHECKING\*(R"\s0 in Object::InsideOut .IP "return" 4 .IX Item "return" The value returned by a \fIset/combined\fR accessor generated by Object::InsideOut. See "\fISet\fR Accessor Return Value" in Object::InsideOut .IP "lvalue" 4 .IX Item "lvalue" The method is an :lvalue accessor. .IP "restricted" 4 .IX Item "restricted" The method is \fIrestricted\fR (i.e., callable only from within the class hierarchy; not callable from application code). See \*(L"\s-1PERMISSIONS\*(R"\s0 in Object::InsideOut. .RE .RS 4 .RE .IP "My::Class\->\fBcan()\fR;" 4 .IX Item "My::Class->can();" .PD 0 .ie n .IP "$obj\->\fBcan()\fR;" 4 .el .IP "\f(CW$obj\fR\->\fBcan()\fR;" 4 .IX Item "$obj->can();" .PD When called in an array context, calling \f(CW\*(C`\->can()\*(C'\fR without any arguments on an Object::InsideOut class or object returns a list of the method names for that class or object, and is equivalent to: .Sp .Vb 2 \& my %meths = $obj\->meta()\->get_methods(); \& my @methods = keys(%meths); .Ve .Sp When called in a scalar context, it returns an array ref containing the method names. .SS "\s-1METADATA ATTRIBUTES\s0" .IX Subsection "METADATA ATTRIBUTES" Class authors may add the \f(CW\*(C`:Method\*(C'\fR attribute to subroutines in their classes to specifically designate them as OO-callable methods. If a method is only a \&\fIclass\fR method or only an \fIobject\fR method, this may be added as a parameter to the attribute: .PP .Vb 3 \& sub my_method :Method(class) \& { \& ... .Ve .PP The \fIclass\fR or \fIobject\fR parameter will appear in the metadata for the method when listed using \f(CW\*(C`\->get_methods()\*(C'\fR. .PP \&\fB\s-1CAUTION:\s0\fR Be sure not to use \f(CW\*(C`:method\*(C'\fR (all lowercase) except as appropriate (see \*(L"\s-1ARGUMENT VALIDATION\*(R"\s0 in Object::InsideOut) as this is a Perl reserved attribute. .PP The \f(CW\*(C`:Sub\*(C'\fR attribute can be used to designate subroutines that are not OO-callable methods. These subroutines will not show up as part of the methods listed by \f(CW\*(C`\->get_methods()\*(C'\fR, etc.. .PP Subroutine names beginning with an underscore are, by convention, considered private, and will not show up as part of the methods listed by \&\f(CW\*(C`\->get_methods()\*(C'\fR, etc.. .SS "\s-1ADDING METADATA\s0" .IX Subsection "ADDING METADATA" Class authors may add additional metadata to their methods using the \&\f(CW\*(C`add_meta()\*(C'\fR subroutine which is exported by this package. For example, if the class implements it own \f(CW\*(C`:lvalue\*(C'\fR method, it should add that metadata so that it is picked up the \f(CW\*(C`\->get_methods()\*(C'\fR: .PP .Vb 3 \& package My::Class; { \& use Object::InsideOut; \& use Object::InsideOut::Metadata; \& \& sub my_method :lvalue :Method(object) \& { \& .... \& } \& add_meta(_\|_PACKAGE_\|_, \*(Aqmy_method\*(Aq, \*(Aqlvalue\*(Aq, 1); \& } .Ve .PP The arguments to \f(CW\*(C`add_meta()\*(C'\fR are: .IP "Class name" 4 .IX Item "Class name" This can usually be designated using the special literal C_\|_PACKAGE_\|_>. .IP "Method name" 4 .IX Item "Method name" .PD 0 .IP "Metadata name" 4 .IX Item "Metadata name" .PD This can be any of the metadata names under \*(L"\s-1METHODS METADATA\*(R"\s0, or can be whatever additional name the programmer chooses to implement. .IP "Metadata value" 4 .IX Item "Metadata value" .PP When adding multiple metadata for a method, they may be enclosed in a single hash ref: .PP .Vb 2 \& add_meta(_\|_PACKAGE_\|_, \*(Aqmy_method\*(Aq, { \*(Aqlvalue\*(Aq => 1, \& \*(Aqreturn\*(Aq => \*(Aqold\*(Aq }); .Ve .PP If adding metadata for multiple methods, another level of hash may be used: .PP .Vb 3 \& add_meta(_\|_PACKAGE_\|_, { \*(Aqmy_method\*(Aq => { \*(Aqlvalue\*(Aq => 1, \& \*(Aqreturn\*(Aq => \*(Aqold\*(Aq }, \& \*(Aqget_info\*(Aq => { \*(Aqmy_meta\*(Aq => \*(Aqtrue\*(Aq } }); .Ve .SH "TO DO" .IX Header "TO DO" Provide filtering capabilities on the method information returned by \&\f(CW\*(C`\->get_methods()\*(C'\fR. .SH "REQUIREMENTS" .IX Header "REQUIREMENTS" Perl 5.8.0 or later .SH "SEE ALSO" .IX Header "SEE ALSO" Object::InsideOut .PP Perl 6 introspection: , and .SH "AUTHOR" .IX Header "AUTHOR" Jerry D. Hedden, .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright 2006 \- 2012 Jerry D. Hedden. All rights reserved. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.