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