The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

App::Serializer::Storable - Interface for serialization and deserialization

SYNOPSIS

    use App;

    $context = App->context();
    $serializer = $context->service("Serializer");  # or ...
    $serializer = $context->serializer();
    $data = {
        an => 'arbitrary',
        collection => [ 'of', 'data', ],
        of => {
            arbitrary => 'depth',
        },
    };
    $stor = $serializer->serialize($data);
    $data = $serializer->deserialize($stor);
    print $serializer->dump($data), "\n";

DESCRIPTION

A Serializer allows you to serialize a structure of data of arbitrary depth to a scalar and deserialize it back to the structure.

The Storable serializer uses the Storable class to perform the deserialization and serialization.

Class: App::Serializer::Storable

 * Throws: App::Exception::Serializer
 * Since:  0.01

Design

The class is entirely made up of static (class) methods. However, they are each intended to be called as methods on the instance itself.

Constructor Methods:

new()

The constructor is inherited from App::Service.

Public Methods:

serialize()

    * Signature: $stor = $serializer->serialize($data);
    * Param:     $data              ref
    * Return:    $stor              binary
    * Throws:    App::Exception::Serializer
    * Since:     0.01

    Sample Usage: 

    $context = App->context();
    $serializer = $context->service("Serializer");  # or ...
    $serializer = $context->serializer();
    $data = {
        an => 'arbitrary',
        collection => [ 'of', 'data', ],
        of => {
            arbitrary => 'depth',
        },
    };
    $stor = $serializer->serialize($data);

deserialize()

    * Signature: $data = $serializer->deserialize($stor);
    * Signature: $data = App::Serializer->deserialize($stor);
    * Param:     $data              ref
    * Return:    $stor              binary
    * Throws:    App::Exception::Serializer
    * Since:     0.01

    Sample Usage: 

    $context = App->context();
    $serializer = $context->service("Serializer");  # or ...
    $serializer = $context->serializer();
    $data = $serializer->deserialize($stor);
    print $serializer->dump($data), "\n";

serialized_content_type()

    * Signature: $serialized_content_type = $service->serialized_content_type();
    * Param:     void
    * Return:    $serialized_content_type   string
    * Throws:    App::Exception
    * Since:     0.01

    Sample Usage: 

    $serialized_content_type = $service->serialized_content_type();

dump()

This method is inherited from App::Serializer.

ACKNOWLEDGEMENTS

 * Author:  Stephen Adkins <spadkins@gmail.com>
 * License: This is free software. It is licensed under the same terms as Perl itself.

SEE ALSO

App::Context, App::Service