diff options
author | Robin Edwards <robin.ge@gmail.com> | 2010-11-09 09:04:55 +0000 |
---|---|---|
committer | franck cuny <franck@lumberjaph.net> | 2010-11-25 11:00:29 +0100 |
commit | 0d2e13486e84b20992a6a5d35b3c445a32eb22a9 (patch) | |
tree | 91c35c915be96530031f6bce6704c9e609f2c186 /lib | |
parent | prepare release (diff) | |
download | net-riak-0d2e13486e84b20992a6a5d35b3c445a32eb22a9.tar.gz |
support for adding bucket as objects in add method
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Net/Riak/MapReduce.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Net/Riak/MapReduce.pm b/lib/Net/Riak/MapReduce.pm index 8ebe563..d05c30a 100644 --- a/lib/Net/Riak/MapReduce.pm +++ b/lib/Net/Riak/MapReduce.pm @@ -56,8 +56,10 @@ sub add { } if (!scalar @_) { - if (blessed($arg)) { + if ($arg->isa('Net::Riak::Object')) { $self->add_object($arg); + } elsif ($arg->isa('Net::Riak::Bucket')) { + $self->add_bucket($arg->name); } else { $self->add_bucket($arg); } @@ -164,6 +166,7 @@ sub run { $job->{timeout} = $timeout; } + my $content = JSON::encode_json($job); my $request = $self->client->new_request( @@ -253,7 +256,7 @@ The MapReduce object allows you to build up and run a map/reduce operations on R =head2 add -arguments: bucketname or arrays or L<Net::Riak::Object> +arguments: L<Net::Riak::Bucket> / Bucket name / L<Net::Riak::Object> / Array return: a Net::Riak::MapReduce object |