2 package MooseX::Storage::Format::YAML;
5 # When I add YAML::LibYAML
6 # Tests break because tye YAML is invalid...?
10 [ qw[YAML::Syck YAML] ],
14 our $VERSION = '0.02';
20 my ( $class, $yaml, @args ) = @_;
21 $class->unpack( Load($yaml), @args );
25 my ( $self, @args ) = @_;
26 Dump( $self->pack(@args) );
37 MooseX::Storage::Format::YAML
45 with Storage('format' => 'YAML');
47 has 'x' => (is => 'rw', isa => 'Int');
48 has 'y' => (is => 'rw', isa => 'Int');
52 my $p = Point->new(x => 10, y => 10);
54 ## methods to freeze/thaw into
55 ## a specified serialization format
56 ## (in this case YAML)
58 # pack the class into a YAML string
66 # unpack the JSON string into a class
67 my $p2 = Point->thaw(<<YAML);
94 All complex software has bugs lurking in it, and this module is no
95 exception. If you find a bug please either email me, or add the bug
100 Chris Prather E<lt>chris.prather@iinteractive.comE<gt>
102 Stevan Little E<lt>stevan.little@iinteractive.comE<gt>
104 =head1 COPYRIGHT AND LICENSE
106 Copyright 2007 by Infinity Interactive, Inc.
108 L<http://www.iinteractive.com>
110 This library is free software; you can redistribute it and/or modify
111 it under the same terms as Perl itself.