Jozef Kutej > Data-Keys-0.02 > Data::Keys::E::Value::InfDef

Download:
Data-Keys-0.02.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.02   Source  

NAME ^

Data::Keys::E::Value::InfDef - inflate/deflate values

SYNOPSIS ^

    use Date::Keys;
        my $dk = Data::Keys->new(
                'base_dir'    => '/folder/full/of/json/files',
                'extend_with' => ['Store::Dir', 'Value::InfDef'],
                'inflate'     => sub { JSON::Util->decode($_[0]) },
                'deflate'     => sub { JSON::Util->encode($_[0]) },
        );

        my %data = %{$dk->get('abcd.json')};
        $dk->set('abcd.json', \%data);

DESCRIPTION ^

Uses callback to automatically inflate and deflate.

PROPERTIES ^

inflate

Callback executed with get value.

deflate

Callback executed with set value.

AUTHOR ^

Jozef Kutej

syntax highlighting: