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.19';
15 our $AUTHORITY = 'cpan:STEVAN';
21 my ( $class, $yaml, @args ) = @_;
22 $class->unpack( Load($yaml), @args );
26 my ( $self, @args ) = @_;
27 Dump( $self->pack(@args) );
38 MooseX::Storage::Format::YAML - A YAML serialization role
46 with Storage('format' => 'YAML');
48 has 'x' => (is => 'rw', isa => 'Int');
49 has 'y' => (is => 'rw', isa => 'Int');
53 my $p = Point->new(x => 10, y => 10);
55 ## methods to freeze/thaw into
56 ## a specified serialization format
57 ## (in this case YAML)
59 # pack the class into a YAML string
67 # unpack the JSON string into a class
68 my $p2 = Point->thaw(<<YAML);
95 All complex software has bugs lurking in it, and this module is no
96 exception. If you find a bug please either email me, or add the bug
101 Chris Prather E<lt>chris.prather@iinteractive.comE<gt>
103 Stevan Little E<lt>stevan.little@iinteractive.comE<gt>
105 =head1 COPYRIGHT AND LICENSE
107 Copyright 2007-2008 by Infinity Interactive, Inc.
109 L<http://www.iinteractive.com>
111 This library is free software; you can redistribute it and/or modify
112 it under the same terms as Perl itself.