From b398c46825dc73ac92677893dd2a714cd21f8a4d Mon Sep 17 00:00:00 2001 From: dakkar Date: Sat, 26 Mar 2011 12:40:12 +0000 Subject: collections working, subclasses, strings --- bin/client | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'bin/client') diff --git a/bin/client b/bin/client index 8675f18..c5e2a65 100644 --- a/bin/client +++ b/bin/client @@ -6,8 +6,9 @@ use DeWeave::Storage; use DeWeave::Crypto; use DeWeave::Collection; use Getopt::Long; +use Class::MOP; -my ($server,$username,$password,$sync_key); +my ($server,$username,$password,$sync_key,$what); { my $p = Getopt::Long::Parser->new( @@ -38,12 +39,11 @@ my $crypto = DeWeave::Crypto->new({ sync_key => $sync_key, }); -use Data::Dump 'pp'; -my $data = $storage->get_item('storage/tabs'); +$what=ucfirst(shift); +my $class = "DeWeave::Collection::$what"; +Class::MOP::load_class($class); -my $foo = DeWeave::Collection->from_json( - $data, - $crypto, -); +my $foo = $class->fetch($storage,$crypto); + +print $_->as_string,"\n" for @{$foo->items}; -print pp $foo; -- cgit v1.2.3