Class: BatchApi::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/batch_api/response.rb

Overview

Public: a response from an internal operation in the Batch API. It contains all the details that are needed to describe the call’s outcome.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Response

Public: create a new response representation from a Rack-compatible response (e.g. [status, headers, response_object]).



13
14
15
16
# File 'lib/batch_api/response.rb', line 13

def initialize(response)
  @status, @headers = *response
  @body = process_body(response[2])
end

Instance Attribute Details

#bodyObject

Public: the attributes of the HTTP response.



9
10
11
# File 'lib/batch_api/response.rb', line 9

def body
  @body
end

#headersObject

Public: the attributes of the HTTP response.



9
10
11
# File 'lib/batch_api/response.rb', line 9

def headers
  @headers
end

#statusObject

Public: the attributes of the HTTP response.



9
10
11
# File 'lib/batch_api/response.rb', line 9

def status
  @status
end