2 package MooseX::Storage::IO::File;
5 use MooseX::Storage::Engine::IO::File;
13 my ( $class, $filename ) = @_;
14 $class->thaw( MooseX::Storage::Engine::IO::File->new( file => $filename )->load() );
18 my ( $self, $filename ) = @_;
19 MooseX::Storage::Engine::IO::File->new( file => $filename )->store( $self->freeze() );
30 MooseX::Storage::IO::File
38 with Storage('format' => 'JSON', 'io' => 'File');
40 has 'x' => (is => 'rw', isa => 'Int');
41 has 'y' => (is => 'rw', isa => 'Int');
45 my $p = Point->new(x => 10, y => 10);
47 ## methods to load/store a class
50 $p->store('my_point.json');
52 my $p2 = Point->load('my_point.json');
58 =item B<load ($filename)>
60 =item B<store ($filename)>
74 All complex software has bugs lurking in it, and this module is no
75 exception. If you find a bug please either email me, or add the bug
80 Chris Prather E<lt>chris.prather@iinteractive.comE<gt>
82 Stevan Little E<lt>stevan.little@iinteractive.comE<gt>
84 =head1 COPYRIGHT AND LICENSE
86 Copyright 2007 by Infinity Interactive, Inc.
88 L<http://www.iinteractive.com>
90 This library is free software; you can redistribute it and/or modify
91 it under the same terms as Perl itself.