.\" Automatically generated by Pod::Man 4.11 (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 .\" ======================================================================== .\" .IX Title "MooseX::FunctionParametersInfo 3pm" .TH MooseX::FunctionParametersInfo 3pm "2020-08-09" "perl v5.30.3" "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" MooseX::FunctionParametersInfo \- make Function::Parameters::info() data available within the meta object protocol .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 4 \& package Foo { \& use Function::Parameters; \& use Moose; \& use MooseX::FunctionParametersInfo; \& \& method bar (Str $x, Int $y) { \& ...; \& } \& } \& \& my $method = Class::MOP::class_of(\*(AqFoo\*(Aq)\->get_method(\*(Aqbar\*(Aq); \& printf("%s %s\en", $_\->type, $_\->name) \& for $method\->positional_parameters; \& \& _\|_END_\|_ \& Str $x \& Int $y .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Function::Parameters provides declarative sugar for processing arguments to subs, and provides a small \s-1API\s0 to query the declarations. .PP Moose provides a comprehensive introspection \s-1API\s0 for Perl classes. .PP MooseX::FunctionParametersInfo marries them together, injecting information from Function::Parameters into Moose's meta objects. .PP MooseX::FunctionParametersInfo is currently distributed as part of Moops, but is fairly independent of the rest of it, and may be spun off as a separate release in the future. .SS "Methods" .IX Subsection "Methods" MooseX::FunctionParametersInfo adds the following methods to the Moose::Meta::Method objects for your class. If your method is wrapped, it is the info from the original (wrapped) method that is reported; not the info from the wrapper. If your method was not declared via Function::Parameters (e.g. it was declared using the Perl built-in \&\f(CW\*(C`sub\*(C'\fR keyword) then we make a best guess. .PP Methods that return parameters, return Function::Parameters::Parameter objects, which have \f(CW\*(C`name\*(C'\fR and \f(CW\*(C`type\*(C'\fR methods. The type (if any) will be a blessed type constraint object, such as a Moose::Meta::TypeConstraint or Type::Tiny object. .ie n .IP """declaration_keyword""" 4 .el .IP "\f(CWdeclaration_keyword\fR" 4 .IX Item "declaration_keyword" Returns the name of the keyword used to declare the method; e.g. \f(CW"sub"\fR or \f(CW"method"\fR. .ie n .IP """slurpy_parameter""" 4 .el .IP "\f(CWslurpy_parameter\fR" 4 .IX Item "slurpy_parameter" The array parameter into which additional arguments will be slurped, or undef. .ie n .IP """invocant_parameter""" 4 .el .IP "\f(CWinvocant_parameter\fR" 4 .IX Item "invocant_parameter" The parameter which is the method's invocant (typically, \&\f(CW$self\fR or \f(CW$class\fR), or undef. .ie n .IP """positional_required_parameters"", ""positional_optional_parameters"" ""named_required_parameters"", ""named_optional_parameters""" 4 .el .IP "\f(CWpositional_required_parameters\fR, \f(CWpositional_optional_parameters\fR \f(CWnamed_required_parameters\fR, \f(CWnamed_optional_parameters\fR" 4 .IX Item "positional_required_parameters, positional_optional_parameters named_required_parameters, named_optional_parameters" Returns the appropriate parameters as a list. .ie n .IP """positional_parameters"", ""named_parameters""" 4 .el .IP "\f(CWpositional_parameters\fR, \f(CWnamed_parameters\fR" 4 .IX Item "positional_parameters, named_parameters" A list of the required parameters followed by optional parameters. .ie n .IP """minimum_parameters"", ""maximum_parameters""" 4 .el .IP "\f(CWminimum_parameters\fR, \f(CWmaximum_parameters\fR" 4 .IX Item "minimum_parameters, maximum_parameters" The minimum and maximum number of parameters the method can take. .SH "BUGS" .IX Header "BUGS" Please report any bugs to . .SH "SEE ALSO" .IX Header "SEE ALSO" Moose, Function::Parameters, Function::Parameters::Info. .PP Moops. .SH "AUTHOR" .IX Header "AUTHOR" Toby Inkster . .SH "COPYRIGHT AND LICENCE" .IX Header "COPYRIGHT AND LICENCE" This software is copyright (c) 2013\-2014 by Toby Inkster. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. .SH "DISCLAIMER OF WARRANTIES" .IX Header "DISCLAIMER OF WARRANTIES" \&\s-1THIS PACKAGE IS PROVIDED \*(L"AS IS\*(R" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.\s0