-
-
17 Sep 2021 07:10:23 UTC
- Distribution: Catmandu
- Module version: 1.2016
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (36)
- Testers (205 / 25 / 3)
- Kwalitee
Bus factor: 4- 87.53% Coverage
- License: perl_5
- Perl: v5.10.1
- Activity
24 month- Tools
- Download (813.62KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 18 contributors- Nicolas Steenlant, C<< <nicolas.steenlant at ugent.be> >>
-
Christian Pietsch
-
Dave Sherohman
-
Doug Bell
-
EC2 Default User
-
Jakob Voß
-
Johann Rolschewski
-
Magnus Enger
-
Matthias Vandermaesen
-
Mohammad S Anwar
-
Nicolas Franck
-
Patrick Hochstenbach
-
Pieter De Praetere
-
Snorri Briem
-
Stefan Weil
-
Tom Hukins
-
Upasana Shukla
-
Vitali Peil
- Dependencies
- Any::URI::Escape
- App::Cmd
- CGI::Expand
- Class::Method::Modifiers
- Clone
- Config::Onion
- Cpanel::JSON::XS
- Data::Compare
- Data::Util
- HTTP::Request
- Hash::Merge::Simple
- IO::Handle::Util
- LWP::UserAgent
- List::MoreUtils
- Log::Any
- Log::Any::Adapter
- MIME::Types
- Module::Build
- Module::Info
- Moo
- MooX::Aliases
- Package::Stash
- Parser::MGC
- Path::Iterator::Rule
- Path::Tiny
- Role::Tiny
- Role::Tiny::With
- String::CamelCase
- Sub::Exporter
- Sub::Quote
- Text::CSV
- Text::Hogan::Compiler
- Throwable
- Time::HiRes
- Try::Tiny::ByClass
- URI
- URI::Template
- UUID::Tiny
- Unicode::Normalize
- YAML::XS
- asa
- namespace::clean
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Catmandu::Fix::Has - helper class for creating Fix-es with (optional) parameters
SYNOPSIS
package Catmandu::Fix::foo; use Moo; use Catmandu::Fix::Has; has greeting => (fix_arg => 1); # required parameter 1 has message => (fix_arg => 1); # required parameter 2 has eol => (fix_opt => 1 , default => sub {'!'} ); # optional parameter 'eol' with default '!' sub fix { my ($self,$data) = @_; print STDERR $self->greeting . ", " . $self->message . $self->eol . "\n"; $data; } 1;
PARAMETERS
- fix_arg
-
Required argument when set to 1. The Fix containing the code fragment below needs two arguments.
use Catmandu::Fix::Has; has message => (fix_arg => 1); # required parameter 1 has number => (fix_arg => 1); # required parameter 2
When the fix_arg is set to 'collect', then all arguments are read into an array. The Fix containing the code fragment below needs at least 1 or more arguments. All arguments will get collected into the
messages
array:use Catmandu::Fix::Has; has messages => (fix_arg => 'collect'); # required parameter
- fix_opt
-
Optional named argument when set to 1. The Fix containing the code fragment below can have two optional arguments
message: ...
,number: ...
:use Catmandu::Fix::Has; has message => (fix_opt => 1); # optional parameter 1 has number => (fix_opt => 1); # optional parameter 2
When the fix_opt is set to 'collect', then all optional argument are read into an array. The Fix containing the code fragment below needs at least 1 or more arguments. All arguments will get collected into the
options
array:use Catmandu::Fix::Has; has options => (fix_opt => 'collect'); # optional parameter
SEE ALSO
Module Install Instructions
To install Catmandu, copy and paste the appropriate command in to your terminal.
cpanm Catmandu
perl -MCPAN -e shell install Catmandu
For more information on module installation, please visit the detailed CPAN module installation guide.