2 package MooseX::Storage;
8 return if $pkg eq 'main';
11 || confess "This package can only be used in Moose based classes";
13 $pkg->meta->alias_method('Storage' => sub {
16 $params{'base'} ||= 'Basic';
19 ('MooseX::Storage::' . $params{'base'}),
23 # you don't have to have a format
24 # role, this just means you dont
25 # get anything other than pack/unpack
26 push @roles => 'MooseX::Storage::Format::' . $params{'format'}
27 if exists $params{'format'};
30 # if you do choose an IO role, then
31 # you *must* have a format role chosen
32 # since load/store require freeze/thaw
33 if (exists $params{'io'}) {
34 (exists $params{'format'})
35 || confess "You must specify a format role in order to use an IO role";
36 push @roles => 'MooseX::Storage::IO::' . $params{'io'};
39 Class::MOP::load_class($_)
40 || die "Could not load role (" . $_ . ") for package ($pkg)"
55 MooseX::Storage - A persistence framework for Moose classes
79 All complex software has bugs lurking in it, and this module is no
80 exception. If you find a bug please either email me, or add the bug
85 Chris Prather E<lt>chris.prather@iinteractive.comE<gt>
87 Stevan Little E<lt>stevan.little@iinteractive.comE<gt>
89 =head1 COPYRIGHT AND LICENSE
91 Copyright 2007 by Infinity Interactive, Inc.
93 L<http://www.iinteractive.com>
95 This library is free software; you can redistribute it and/or modify
96 it under the same terms as Perl itself.