Closed nichtich closed 9 years ago
Catmandu::Fixable only supports instances of Catmandu::Fix, so one has to create a new Fix for any code that fixes items:
{ package MyFix; use parent 'Catmandu::Fix'; sub fix { my ($self, $data) = @_; $data->{my} = "something"; $data; } } my $myfix = MyFix->new(fixes => []); exporter('YAML', fix => $myfix);
This should be easier, e.g.
my $myfix = sub { $_[0]->{my} = "something"; $_[0] }; exporter('YAML', fix => ['Code', code => $myfix ] ); exporter('YAML', fix => $myfix ); # short form
Implemented in the dev branch.
dev
released in 0.9207
Catmandu::Fixable only supports instances of Catmandu::Fix, so one has to create a new Fix for any code that fixes items:
This should be easier, e.g.