08525e911ab3f720b60142b03e32f3de8b85c3a8
[gitmo/MooseX-Storage.git] / lib / MooseX / Storage / Format / YAML.pm
1
2 package MooseX::Storage::Format::YAML;
3 use Moose::Role;
4
5 use Best [
6     [ qw[YAML::Syck YAML] ], 
7     [ qw[Load Dump] ]
8 ];
9
10 requires 'pack';
11 requires 'unpack';
12
13 sub thaw {
14     my ( $class, $json ) = @_;
15     $class->unpack( Load($json) );
16 }
17
18 sub freeze {
19     my $self = shift;
20     Dump( $self->pack() );
21 }
22
23 1;
24
25 __END__
26
27 =pod
28
29 =head1 NAME
30
31 MooseX::Storage::Format::YAML
32
33 =head1 SYNOPSIS
34
35 =head1 DESCRIPTION
36
37 =head1 METHODS
38
39 =over 4
40
41 =item B<freeze>
42
43 =item B<thaw ($json)>
44
45 =back
46
47 =head2 Introspection
48
49 =over 4
50
51 =item B<meta>
52
53 =back
54
55 =head1 BUGS
56
57 All complex software has bugs lurking in it, and this module is no 
58 exception. If you find a bug please either email me, or add the bug
59 to cpan-RT.
60
61 =head1 AUTHOR
62
63 Chris Prather E<lt>chris.prather@iinteractive.comE<gt>
64
65 Stevan Little E<lt>stevan.little@iinteractive.comE<gt>
66
67 =head1 COPYRIGHT AND LICENSE
68
69 Copyright 2007 by Infinity Interactive, Inc.
70
71 L<http://www.iinteractive.com>
72
73 This library is free software; you can redistribute it and/or modify
74 it under the same terms as Perl itself.
75
76 =cut
77
78