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