2 package MooseX::Storage::Format::YAML;
6 [ qw[YAML::Syck YAML] ],
10 our $VERSION = '0.02';
16 my ( $class, $json, @args ) = @_;
17 $class->unpack( Load($json), @args );
21 my ( $self, @args ) = @_;
22 Dump( $self->pack(@args) );
33 MooseX::Storage::Format::YAML
41 with Storage('format' => 'YAML');
43 has 'x' => (is => 'rw', isa => 'Int');
44 has 'y' => (is => 'rw', isa => 'Int');
48 my $p = Point->new(x => 10, y => 10);
50 ## methods to freeze/thaw into
51 ## a specified serialization format
52 ## (in this case YAML)
54 # pack the class into a YAML string
62 # unpack the JSON string into a class
63 my $p2 = Point->thaw(<<YAML);
90 All complex software has bugs lurking in it, and this module is no
91 exception. If you find a bug please either email me, or add the bug
96 Chris Prather E<lt>chris.prather@iinteractive.comE<gt>
98 Stevan Little E<lt>stevan.little@iinteractive.comE<gt>
100 =head1 COPYRIGHT AND LICENSE
102 Copyright 2007 by Infinity Interactive, Inc.
104 L<http://www.iinteractive.com>
106 This library is free software; you can redistribute it and/or modify
107 it under the same terms as Perl itself.