2 package MooseX::Storage::Format::YAML;
6 [ qw[YAML::Syck YAML] ],
14 my ( $class, $json ) = @_;
15 $class->unpack( Load($json) );
20 Dump( $self->pack() );
31 MooseX::Storage::Format::YAML
39 with Storage('format' => 'YAML');
41 has 'x' => (is => 'rw', isa => 'Int');
42 has 'y' => (is => 'rw', isa => 'Int');
46 my $p = Point->new(x => 10, y => 10);
48 ## methods to freeze/thaw into
49 ## a specified serialization format
50 ## (in this case YAML)
52 # pack the class into a YAML string
60 # unpack the JSON string into a class
61 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.