2 package MooseX::Storage::IO::AtomicFile;
5 use MooseX::Storage::Engine::IO::AtomicFile;
7 with 'MooseX::Storage::IO::File';
10 my ( $self, $filename ) = @_;
11 MooseX::Storage::Engine::IO::AtomicFile->new( file => $filename )->store( $self->freeze() );
22 MooseX::Storage::IO::AtomicFile
30 with Storage('format' => 'JSON', 'io' => 'AtomicFile');
32 has 'x' => (is => 'rw', isa => 'Int');
33 has 'y' => (is => 'rw', isa => 'Int');
37 my $p = Point->new(x => 10, y => 10);
39 ## methods to load/store a class
42 $p->store('my_point.json');
44 my $p2 = Point->load('my_point.json');
50 =item B<load ($filename)>
52 =item B<store ($filename)>
66 All complex software has bugs lurking in it, and this module is no
67 exception. If you find a bug please either email me, or add the bug
72 Chris Prather E<lt>chris.prather@iinteractive.comE<gt>
74 Stevan Little E<lt>stevan.little@iinteractive.comE<gt>
76 =head1 COPYRIGHT AND LICENSE
78 Copyright 2007 by Infinity Interactive, Inc.
80 L<http://www.iinteractive.com>
82 This library is free software; you can redistribute it and/or modify
83 it under the same terms as Perl itself.