The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

CXC::Form::Tiny::Plugin::OptArgs2::Meta - Form metaclass role for OptArgs2

VERSION

version 0.12

DESCRIPTION

This role is applied by CXC::Form::Tiny::Plugin::OptArgs2 to the form's metaclass. It adds new DSL directives, optargs_opts, option, and argument. See CXC::Form::Tiny::Plugin::OptArgs2 for further information.

OBJECT ATTRIBUTES

inherit_required

If true, the option inherits the 'require' attribute from the associated form field. It defaults to true.

inherit_optargs

If true, the output optargs will include those from forms which are superclasses of this one.

inherit_optargs_match

A regular expression which matches the class names of superclass forms to exclude from inheritance. It defaults to undef which is equivalent to matching everything.

nested_path_sep

The string used to separate paths in a nested field when creating the option name. It defaults to _. (Note that a name explicitly passed to the 'option' clause will override the generated name).

METHODS

optargs

  \@optargs = $form_meta->optargs;

Return an array of option and argument specifications compatible with the OptArgs2 optargs option.

rename_options

  $form_meta->rename_options( \%options );

Rename in place the names of the options as returned by OptArgs2.

inflate_optargs

  \%options = $form_meta->inflate( \%optargs );

Inflate the "flat" options hash returned by OptArgs2 into the full hash required to initialize the form.

When the OptArgs2 option specification is generated from the form structure via "optargs", the form structure is flattened into a one dimensional hash. The hash keys are generated from the hierarchical keys and a mapping between the hash keys and the original hierarchy is recorded.

This method restores the original structure.

SUPPORT

Bugs

Please report any bugs or feature requests to bug-cxc-form-tiny-plugin-optargs2@rt.cpan.org or through the web interface at: https://rt.cpan.org/Public/Dist/Display.html?Name=CXC-Form-Tiny-Plugin-OptArgs2

Source

Source is available at

  https://gitlab.com/djerius/cxc-form-tiny-plugin-optargs2

and may be cloned from

  https://gitlab.com/djerius/cxc-form-tiny-plugin-optargs2.git

SEE ALSO

Please see those modules/websites for more information related to this module.

AUTHOR

Diab Jerius <djerius@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2023 by Smithsonian Astrophysical Observatory.

This is free software, licensed under:

  The GNU General Public License, Version 3, June 2007