Module: Parse::API::Batch

Included in:
Client
Defined in:
lib/parse/api/batch.rb

Overview

Defines the Batch interface for the Parse REST API

Instance Method Summary collapse

Instance Method Details

#batch_request(requests) ⇒ Array<Parse::Response>, Parse::Response #batch_request(operation) ⇒ Array<Parse::Response>, Parse::Response

Note:

You cannot use batch_requests with User instances that need to be created.

Overloads:

Returns:



25
26
27
28
29
30
31
# File 'lib/parse/api/batch.rb', line 25

def batch_request(batch_operations)
  unless batch_operations.is_a?(Parse::BatchOperation)
    batch_operations = Parse::BatchOperation.new batch_operations
  end
  response = request(:post, "batch", body: batch_operations.as_json)
  response.success? && response.batch? ? response.batch_responses : response
end