-
-
21 Mar 2022 15:23:34 UTC
- Distribution: Catmandu
- Module version: 1.2019
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (36)
- Testers (334 / 0 / 5)
- Kwalitee
Bus factor: 4- 87.59% Coverage
- License: perl_5
- Perl: v5.14.0
- Activity
24 month- Tools
- Download (814.59KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 19 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
-
Zakariyya Mughal
- 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::Addable - Base class for all Catmandu modules need to implement add
SYNOPSIS
package My::Adder; use Moo; use Data::Dumper; with 'Catmandu::Addable'; sub add { my ($self,$object) = @_; print "So you want to add:\n"; print Dumper($object); 1; } sub commit { my $self = shift; print "And now you are done?\n"; } package main; my $adder = My::Adder->new(fix => ['upcase(foo)']); # prints foo => BAR $adder->add({ foo => 'bar' }); # prints: # foo => BAR # foo => BAR $adder->add_many([ { foo => 'bar' } , { foo => 'bar' }]); # prints a commit statement $adder->commit;
OPTIONS
- autocommit
-
Autocommit when the exporter gets out of scope. Default 0.
METHODS
add($hash)
Receives a Perl hash and should return true or false.
commit
This method is usually called at the end of many add or add_many operations.
INHERIT
If you provide an 'add' method, then automatically your package gets a add_many method, plus a fix attribute which transforms all Perl hashes provided to the add method.
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.