.\" 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 .\" ======================================================================== .\" .IX Title "Kavorka::Parameter 3pm" .TH Kavorka::Parameter 3pm "2019-01-17" "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" Kavorka::Parameter \- a single parameter in a function signature .SH "DESCRIPTION" .IX Header "DESCRIPTION" Kavorka::Parameter is a class where each instance represents a parameter in a function signature. This class is used to help parse the function signature, and also to inject Perl code into the final function. .PP Instances of this class are also returned by Kavorka's function introspection \s-1API.\s0 .SS "Introspection \s-1API\s0" .IX Subsection "Introspection API" A parameter instance has the following methods: .ie n .IP """ID""" 4 .el .IP "\f(CWID\fR" 4 .IX Item "ID" An opaque numeric identifier for this parameter. .ie n .IP """package""" 4 .el .IP "\f(CWpackage\fR" 4 .IX Item "package" Returns the package name the parameter was declared in. .ie n .IP """type""" 4 .el .IP "\f(CWtype\fR" 4 .IX Item "type" A Type::Tiny object representing the type constraint for the parameter, or undef. .ie n .IP """name""" 4 .el .IP "\f(CWname\fR" 4 .IX Item "name" The name of the variable associated with this parameter, including its sigil. .ie n .IP """constraints""" 4 .el .IP "\f(CWconstraints\fR" 4 .IX Item "constraints" An arrayref of additional constraints upon the value. These are given as coderefs. .ie n .IP """named""" 4 .el .IP "\f(CWnamed\fR" 4 .IX Item "named" A boolean indicating whether this is a named parameter. .ie n .IP """named_names""" 4 .el .IP "\f(CWnamed_names\fR" 4 .IX Item "named_names" An arrayref of names for this named parameter. .ie n .IP """position""" 4 .el .IP "\f(CWposition\fR" 4 .IX Item "position" The position for a positional parameter. .ie n .IP """default""" 4 .el .IP "\f(CWdefault\fR" 4 .IX Item "default" A coderef supplying the default value for this parameter. .ie n .IP """default_when""" 4 .el .IP "\f(CWdefault_when\fR" 4 .IX Item "default_when" The string \*(L"=\*(R", \*(L"//=\*(R" or \*(L"||=\*(R". .ie n .IP """traits""" 4 .el .IP "\f(CWtraits\fR" 4 .IX Item "traits" A hashref, where the keys represent names of parameter traits, and the values are booleans. .ie n .IP """sigil""" 4 .el .IP "\f(CWsigil\fR" 4 .IX Item "sigil" The sigil of the variable for this parameter. .ie n .IP """kind""" 4 .el .IP "\f(CWkind\fR" 4 .IX Item "kind" Returns \*(L"our\*(R" for package variables; \*(L"global\*(R" for namespace-qualified package variables (i.e. containing \*(L"::\*(R"); \*(L"magic\*(R" for \f(CW$_\fR and escape char variables like \f(CW\*(C`${^HELLO}\*(C'\fR; \*(L"my\*(R" otherwise. .ie n .IP """readonly"", ""ro""" 4 .el .IP "\f(CWreadonly\fR, \f(CWro\fR" 4 .IX Item "readonly, ro" A boolean indicating whether this variable will be read-only. .ie n .IP """rw""" 4 .el .IP "\f(CWrw\fR" 4 .IX Item "rw" A boolean indicating whether this variable will be read-write. .ie n .IP """locked""" 4 .el .IP "\f(CWlocked\fR" 4 .IX Item "locked" A boolean indicating whether this variable is a locked hash(ref). .ie n .IP """alias""" 4 .el .IP "\f(CWalias\fR" 4 .IX Item "alias" A boolean indicating whether this variable will be an alias. .ie n .IP """copy""" 4 .el .IP "\f(CWcopy\fR" 4 .IX Item "copy" A boolean indicating whether this variable will be a copy (non-alias). .ie n .IP """slurpy""" 4 .el .IP "\f(CWslurpy\fR" 4 .IX Item "slurpy" A boolean indicating whether this variable is slurpy. .ie n .IP """optional""" 4 .el .IP "\f(CWoptional\fR" 4 .IX Item "optional" A boolean indicating whether this variable is optional. .ie n .IP """invocant""" 4 .el .IP "\f(CWinvocant\fR" 4 .IX Item "invocant" A boolean indicating whether this variable is an invocant. .ie n .IP """coerce""" 4 .el .IP "\f(CWcoerce\fR" 4 .IX Item "coerce" A boolean indicating whether this variable should coerce. .SS "Other Methods" .IX Subsection "Other Methods" .ie n .IP """parse""" 4 .el .IP "\f(CWparse\fR" 4 .IX Item "parse" An internal method used to parse a parameter. Only makes sense to use within a Parse::Keyword parser. .ie n .IP """injection""" 4 .el .IP "\f(CWinjection\fR" 4 .IX Item "injection" The string of Perl code to inject for this parameter. .ie n .IP """sanity_check""" 4 .el .IP "\f(CWsanity_check\fR" 4 .IX Item "sanity_check" Tests that the parameter is sane. (For example it would not be sane to have an invocant that is an optional parameter.) .SH "BUGS" .IX Header "BUGS" Please report any bugs to . .SH "SEE ALSO" .IX Header "SEE ALSO" Kavorka::Manual::API, Kavorka::Signature. .SH "AUTHOR" .IX Header "AUTHOR" Toby Inkster . .SH "COPYRIGHT AND LICENCE" .IX Header "COPYRIGHT AND LICENCE" This software is copyright (c) 2013\-2014, 2017 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