use MooseX::Storage::Meta::Attribute::DoNotSerialize;
-our $VERSION = '0.01';
+our $VERSION = '0.07';
+our $AUTHORITY = 'cpan:STEVAN';
sub import {
my $pkg = caller();
$pkg->meta->alias_method('Storage' => sub {
my %params = @_;
- $params{'base'} ||= 'Basic';
+ if (exists $params{'base'}) {
+ $params{'base'} = ('Base::' . $params{'base'});
+ }
+ else {
+ $params{'base'} = 'Basic';
+ }
my @roles = (
('MooseX::Storage::' . $params{'base'}),
use Moose;
use MooseX::Storage;
+ our $VERSION = '0.01';
+
with Storage('format' => 'JSON', 'io' => 'File');
has 'x' => (is => 'rw', isa => 'Int');
## object in perl data structures
# pack the class into a hash
- $p->pack(); # { __CLASS__ => 'Point', x => 10, y => 10 }
+ $p->pack(); # { __CLASS__ => 'Point-0.01', x => 10, y => 10 }
# unpack the hash into a class
- my $p2 = Point->unpack({ __CLASS__ => 'Point', x => 10, y => 10 });
+ my $p2 = Point->unpack({ __CLASS__ => 'Point-0.01', x => 10, y => 10 });
## methods to freeze/thaw into
## a specified serialization format
## (in this case JSON)
# pack the class into a JSON string
- $p->freeze(); # { "__CLASS__" : "Point", "x" : 10, "y" : 10 }
+ $p->freeze(); # { "__CLASS__" : "Point-0.01", "x" : 10, "y" : 10 }
# unpack the JSON string into a class
- my $p2 = Point->thaw('{ "__CLASS__" : "Point", "x" : 10, "y" : 10 }');
+ my $p2 = Point->thaw('{ "__CLASS__" : "Point-0.01", "x" : 10, "y" : 10 }');
## methods to load/store a class
## on the file system