1 package MooseX::Storage::IO::File;
4 use MooseX::Storage::Engine::IO::File;
7 our $AUTHORITY = 'cpan:STEVAN';
13 my ( $class, $filename, @args ) = @_;
14 $class->thaw( MooseX::Storage::Engine::IO::File->new( file => $filename )->load(), @args );
18 my ( $self, $filename, @args ) = @_;
19 MooseX::Storage::Engine::IO::File->new( file => $filename )->store( $self->freeze(@args) );
32 MooseX::Storage::IO::File - A basic File I/O role
40 with Storage('format' => 'JSON', 'io' => 'File');
42 has 'x' => (is => 'rw', isa => 'Int');
43 has 'y' => (is => 'rw', isa => 'Int');
47 my $p = Point->new(x => 10, y => 10);
49 ## methods to load/store a class
52 $p->store('my_point.json');
54 my $p2 = Point->load('my_point.json');
60 =item B<load ($filename)>
62 =item B<store ($filename)>
76 All complex software has bugs lurking in it, and this module is no
77 exception. If you find a bug please either email me, or add the bug
82 Chris Prather E<lt>chris.prather@iinteractive.comE<gt>
84 Stevan Little E<lt>stevan.little@iinteractive.comE<gt>
86 =head1 COPYRIGHT AND LICENSE
88 Copyright 2007-2008 by Infinity Interactive, Inc.
90 L<http://www.iinteractive.com>
92 This library is free software; you can redistribute it and/or modify
93 it under the same terms as Perl itself.