swithc to Data::Dumper
[gitmo/MooseX-Storage.git] / lib / MooseX / Storage / Format / JSON.pm
index cc5544a..9682d6c 100644 (file)
@@ -2,19 +2,25 @@
 package MooseX::Storage::Format::JSON;
 use Moose::Role;
 
+no warnings 'once';
+
 use JSON::Any;
 
+our $VERSION = '0.02';
+
 requires 'pack';
 requires 'unpack';
 
 sub thaw {
-    my ( $class, $json ) = @_;
-    $class->unpack( JSON::Any->jsonToObj($json) );
+    my ( $class, $json, @args ) = @_;
+    local $JSON::UnMapping = 1;
+    $class->unpack( JSON::Any->jsonToObj($json), @args );
 }
 
 sub freeze {
-    my $self = shift;
-    JSON::Any->objToJson( $self->pack() );
+    my ( $self, @args ) = @_;
+    local $JSON::UnMapping = 1;
+    JSON::Any->objToJson( $self->pack(@args) );
 }
 
 1;
@@ -52,8 +58,6 @@ MooseX::Storage::Format::JSON
   # unpack the JSON string into a class
   my $p2 = Point->thaw('{ "__CLASS__" : "Point", "x" : 10, "y" : 10 }');  
 
-=head1 DESCRIPTION
-
 =head1 METHODS
 
 =over 4