projects
/
gitmo/MooseX-Storage.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
Patch to use JSON::Any and Test::JSON
[gitmo/MooseX-Storage.git]
/
lib
/
MooseX
/
Storage
/
Format
/
JSON.pm
1
2
package MooseX::Storage::Format::JSON;
3
use Moose::Role;
4
5
use JSON::Any;
6
7
requires 'pack';
8
requires 'unpack';
9
10
sub thaw {
11
my ( $class, $json ) = @_;
12
$class->unpack( JSON::Any->jsonToObj($json) );
13
}
14
15
sub freeze {
16
my $self = shift;
17
JSON::Any->objToJson( $self->pack() );
18
}
19
20
1;
21
22
__END__
23
24
=pod
25
26
=cut
27