.\" 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 "Perinci::Object::Function 3pm" .TH Perinci::Object::Function 3pm "2018-11-25" "perl v5.28.0" "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" Perinci::Object::Function \- Represent function metadata .SH "VERSION" .IX Header "VERSION" This document describes version 0.310 of Perinci::Object::Function (from Perl distribution Perinci-Object), released on 2018\-10\-18. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Perinci::Object; \& \& $SPEC{foo} = { \& v => 1.1, \& args => { b => {schema=>\*(Aqint\*(Aq, req=>0} }, \& features => {idempotent=>1}, \& }; \& my $risub = risub $SPEC{foo}; \& print $risub\->feature(\*(Aqidempotent\*(Aq), # 1 \& $risub\->arg(\*(Aqb\*(Aq)\->{req}, # 0 \& $risub\->arg(\*(Aqa\*(Aq); # undef .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This class provides an object-oriented interface for function metadata. .SH "METHODS" .IX Header "METHODS" .SS "new($meta) => \s-1OBJECT\s0" .IX Subsection "new($meta) => OBJECT" Create a new object from \f(CW$meta\fR. If \f(CW$meta\fR is undef, creates an empty metadata. .ie n .SS "$risub\->type => str" .el .SS "\f(CW$risub\fP\->type => str" .IX Subsection "$risub->type => str" Will return \f(CW\*(C`function\*(C'\fR. .ie n .SS "$risub\->features => \s-1HASH\s0" .el .SS "\f(CW$risub\fP\->features => \s-1HASH\s0" .IX Subsection "$risub->features => HASH" Return the \f(CW\*(C`features\*(C'\fR property. .ie n .SS "$risub\->feature(NAME[, \s-1VALUE\s0])" .el .SS "\f(CW$risub\fP\->feature(NAME[, \s-1VALUE\s0])" .IX Subsection "$risub->feature(NAME[, VALUE])" Get or set named feature (\fBfeatures\fR property in metadata). If a feature doesn't exist, undef will be returned. .ie n .SS "$risub\->can_dry_run => \s-1BOOL\s0" .el .SS "\f(CW$risub\fP\->can_dry_run => \s-1BOOL\s0" .IX Subsection "$risub->can_dry_run => BOOL" Check whether function can do dry run, either from the \f(CW\*(C`dry_run\*(C'\fR feature, or from the \f(CW\*(C`tx\*(C'\fR feature. (Transaction can be used to emulate dry run, by calling the function with \f(CW\*(C`\-tx_action => \*(Aqcheck_state\*(Aq\*(C'\fR only.) .ie n .SS "$risub\->default_dry_run => \s-1BOOL\s0" .el .SS "\f(CW$risub\fP\->default_dry_run => \s-1BOOL\s0" .IX Subsection "$risub->default_dry_run => BOOL" Starting from Rinci 1.1.83, the \f(CW\*(C`dry_run\*(C'\fR feature property can be a hash instead of a bool, and can contain this pair \f(CW\*(C`default=>1\*(C'\fR to specify that dry-run mode should be the default operation (e.g. for safety). .ie n .SS "$risub\->arg(NAME[, \s-1VALUE\s0])" .el .SS "\f(CW$risub\fP\->arg(NAME[, \s-1VALUE\s0])" .IX Subsection "$risub->arg(NAME[, VALUE])" Get or set argument (\fBargs\fR property in metadata). If an argument doesn't exist, undef will be returned. .SH "HOMEPAGE" .IX Header "HOMEPAGE" Please visit the project's homepage at . .SH "SOURCE" .IX Header "SOURCE" Source repository is at . .SH "BUGS" .IX Header "BUGS" Please report any bugs or feature requests on the bugtracker website .PP When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. .SH "SEE ALSO" .IX Header "SEE ALSO" Perinci::Object .SH "AUTHOR" .IX Header "AUTHOR" perlancar .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011 by perlancar@cpan.org. .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.