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