diff options
author | dakkar <dakkar@thenautilus.net> | 2011-03-25 23:54:14 +0000 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2011-03-25 23:54:14 +0000 |
commit | e1872c5028937753e0ecbebcded8a312d5eb7ce4 (patch) | |
tree | 38cfdbbf3cda37cc23bb760b39d478e9c29a6676 /lib/DeWeave/Collection.pm | |
parent | it might even complie (diff) | |
download | DeWeave-e1872c5028937753e0ecbebcded8a312d5eb7ce4.tar.gz DeWeave-e1872c5028937753e0ecbebcded8a312d5eb7ce4.tar.bz2 DeWeave-e1872c5028937753e0ecbebcded8a312d5eb7ce4.zip |
very broken, can't decrypt
Diffstat (limited to 'lib/DeWeave/Collection.pm')
-rw-r--r-- | lib/DeWeave/Collection.pm | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/DeWeave/Collection.pm b/lib/DeWeave/Collection.pm new file mode 100644 index 0000000..803a8cc --- /dev/null +++ b/lib/DeWeave/Collection.pm @@ -0,0 +1,30 @@ +package DeWeave::Collection; +use Moose; +use namespace::autoclean; +use MooseX::Types::Moose qw(ArrayRef Int Str Num); +use JSON::Any; +use DeWeave::EDO; + +has items => ( + isa => ArrayRef['DeWeave::WBO'], + is => 'ro', + required => 1, +); + +sub from_json { + my ($class,$json,$crypt)=@_; + + my $j = JSON::Any->new; + + my $args = $j->decode($json); + use Data::Dump 'pp';warn pp $args; + + my @items = map { + DeWeave::EDO->new({%$_,__crypt=>$crypt}) + } @$args; + return $class->new({ + items => \@items, + }); +} + +1; |