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);
88 All complex software has bugs lurking in it, and this module is no
89 exception. If you find a bug please either email me, or add the bug
94 Chris Prather E<lt>chris.prather@iinteractive.comE<gt>
96 Stevan Little E<lt>stevan.little@iinteractive.comE<gt>
98 =head1 COPYRIGHT AND LICENSE
100 Copyright 2007 by Infinity Interactive, Inc.
102 L<http://www.iinteractive.com>
104 This library is free software; you can redistribute it and/or modify
105 it under the same terms as Perl itself.