1 package MooseX::Storage::IO::AtomicFile;
4 use MooseX::Storage::Engine::IO::AtomicFile;
7 our $AUTHORITY = 'cpan:STEVAN';
9 with 'MooseX::Storage::IO::File';
12 my ( $self, $filename, @args ) = @_;
13 MooseX::Storage::Engine::IO::AtomicFile->new( file => $filename )->store( $self->freeze(@args) );
26 MooseX::Storage::IO::AtomicFile - An Atomic File I/O role
34 with Storage('format' => 'JSON', 'io' => 'AtomicFile');
36 has 'x' => (is => 'rw', isa => 'Int');
37 has 'y' => (is => 'rw', isa => 'Int');
41 my $p = Point->new(x => 10, y => 10);
43 ## methods to load/store a class
46 $p->store('my_point.json');
48 my $p2 = Point->load('my_point.json');
54 =item B<load ($filename)>
56 =item B<store ($filename)>
70 All complex software has bugs lurking in it, and this module is no
71 exception. If you find a bug please either email me, or add the bug
76 Chris Prather E<lt>chris.prather@iinteractive.comE<gt>
78 Stevan Little E<lt>stevan.little@iinteractive.comE<gt>
80 =head1 COPYRIGHT AND LICENSE
82 Copyright 2007-2008 by Infinity Interactive, Inc.
84 L<http://www.iinteractive.com>
86 This library is free software; you can redistribute it and/or modify
87 it under the same terms as Perl itself.