-
package MooseX::Storage;
use Moose qw(confess);
use MooseX::Storage::Meta::Attribute::DoNotSerialize;
use String::RewritePrefix ();
-our $VERSION = '0.31';
-our $AUTHORITY = 'cpan:STEVAN';
-
sub import {
my $pkg = caller();
use Moose;
use MooseX::Storage;
- our $VERSION = '0.01';
-
with Storage('format' => 'JSON', 'io' => 'File');
has 'x' => (is => 'rw', isa => 'Int');
class is serialized into a Perl HASH reference, it is tagged with the
class name and each instance attribute is stored. Very simple.
-This level is not optional, it is the bare minumum that
+This level is not optional, it is the bare minimum that
MooseX::Storage provides and all other levels build on top of this.
See L<MooseX::Storage::Basic> for the fundamental implementation and
This level is optional, if you don't want/need it, you don't have to
have it. You can just use C<pack>/C<unpack> instead.
+=for stopwords io
+
=item B<io>
The third (io) level is C<load> and C<store>. In this level we are reading
=item OnlyWhenBuilt
-Only attributes that have been built (ie, where the predicate returns
+Only attributes that have been built (i.e., where the predicate returns
'true') will be serialized. This avoids any potentially expensive computations.
See L<MooseX::Storage::Traits::OnlyWhenBuilt> for details.
With Array and Hash references the first level down is inspected and
any objects found are serialized/deserialized for you. We do not do
-this recusively by default, however this feature may become an
+this recursively by default, however this feature may become an
option eventually.
+=for stopwords subtypes
+
The specific serialize/deserialize routine is determined by the
Moose type constraint a specific attribute has. In most cases subtypes
of the supported types are handled correctly, and there is a facility
Storage(format => '=My::Private::JSONFormat');
+=for stopwords parameterized
+
To use a parameterized role (for which, see L<MooseX::Role::Parameterized>) you
can pass an arrayref of the role name (in short or long form, as above) and its
parameters:
=back
+=for stopwords TODO
+
=head1 TODO
This module needs docs and probably a Cookbook of some kind as well.
it under the same terms as Perl itself.
=cut
+
+