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