Class: Elements::ElementsResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/elements/elements_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http_resp) ⇒ ElementsResponse

Returns a new instance of ElementsResponse.



7
8
9
10
11
12
# File 'lib/elements/elements_response.rb', line 7

def initialize(http_resp)
  @body = http_resp.body
  @headers = http_resp.headers
  @status = http_resp.code
  @data = JSON.parse(http_resp.body, symbolize_names: true)
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



5
6
7
# File 'lib/elements/elements_response.rb', line 5

def body
  @body
end

#dataObject (readonly)

Returns the value of attribute data.



5
6
7
# File 'lib/elements/elements_response.rb', line 5

def data
  @data
end

#headersObject (readonly)

Returns the value of attribute headers.



5
6
7
# File 'lib/elements/elements_response.rb', line 5

def headers
  @headers
end

#statusObject (readonly)

Returns the value of attribute status.



5
6
7
# File 'lib/elements/elements_response.rb', line 5

def status
  @status
end