From 0d2e13486e84b20992a6a5d35b3c445a32eb22a9 Mon Sep 17 00:00:00 2001 From: Robin Edwards Date: Tue, 9 Nov 2010 09:04:55 +0000 Subject: support for adding bucket as objects in add method --- lib/Net/Riak/MapReduce.pm | 7 +++++-- 1 file 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 +arguments: L / Bucket name / L / Array return: a Net::Riak::MapReduce object -- cgit 1.4.1