NAME

Paludis::ResumeState::Serialization::Basic - Basic & Consistent Resume-State serialization interface.

VERSION

version 0.01000410

SYNOPSIS

See ::Serialization for recommended usage.

This interface provides a very "dumb" but consistent serialization support.

ResumeData@1234(foo="bar";baz="quux";doo=c(1="baz";2="buzz";3="bizz";count="3";);borzoi=Hysterical(););

Will be deserialized as follows:

{
  ResumeSpec => {
    type       => 'class',
    classname  => 'ResumeData',
    pid        => '1234',
    parameters => [
      [ 'foo', 'bar' ],
      [ 'baz', 'quux' ],
      [
        'doo',
        {
          type       => 'array',
          parameters => [ 'baz', 'buzz', 'bizz' ],
          count      => 3
        }
      ],
      [
        'borzoi',
        {
          type       => 'class',
          classname  => 'Hysterical',
          parameters => [],
        }
      ],
    ],
  },
}

And giving that exact structure to serialize, will return the aforementioned serialized string.

METHODS

serialize

my $string = ->serialize( $data );

deserialize

my $object = ->deserialize( $content );

AUTHOR

Kent Fredric <kentnl@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Kent Fredric <kentnl@cpan.org>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.