lib/parse/batch.rb in parse-ruby-client-0.1.15 vs lib/parse/batch.rb in parse-ruby-client-0.2.0
- old
+ new
@@ -1,12 +1,14 @@
require 'json'
module Parse
class Batch
attr_reader :requests
+ attr_reader :client
- def initialize
+ def initialize(client = Parse.client)
+ @client = client
@requests ||= []
end
def add_request(request)
@requests << request
@@ -42,12 +44,11 @@
end
def run!
uri = Parse::Protocol.batch_request_uri
body = {:requests => @requests}.to_json
- Parse.client.request(uri, :post, body)
+ @client.request(uri, :post, body)
end
-
end
end
\ No newline at end of file