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.