SYNOPSIS
package Catmandu::Serializer::Foo;
use Moo;
sub serialize {
my ($self,$data) = @_;
.. transform the data to a string and return it...
}
sub deserialize {
my ($self,$string) = @_;
... transform the string into a perl hash ...
}
package MyPackage;
use Moo;
with 'Catmandu::Serializer';
package main;
my $pkg = MyPackage->new;
my $string = $pkg->serialize({ foo => 'bar' });
my $perl = $pkg->deserialize($string);
# Using Catmandu::Serializer::Foo
my $pkg = MyPackage->new( serialization_format => 'Foo' );
my $string = $pkg->serialize({ foo => 'bar' });
my $perl = $pkg->deserialize($string);