2 package MooseX::Storage::JSON;
5 with 'MooseX::Storage::Base';
8 use MooseX::Storage::Engine;
12 my $e = MooseX::Storage::Engine->new(object => $self);
17 my ($class, $data) = @_;
18 my $e = MooseX::Storage::Engine->new(class => $class);
19 $class->new($e->expand_object($data));
23 my ($class, $filename) = @_;
24 $class->unpack(JSON::Syck::LoadFile($filename));
28 my ($self, $filename) = @_;
29 JSON::Syck::DumpFile($filename, $self->pack());
33 my ($class, $json) = @_;
34 $class->unpack(JSON::Syck::Load($json));
39 JSON::Syck::Dump($self->pack());