Class: Iwoca::Response

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/iwoca/response.rb

Instance Method Summary collapse

Constructor Details

#initialize(http_response) ⇒ Response

Returns a new instance of Response.



11
12
13
# File 'lib/iwoca/response.rb', line 11

def initialize(http_response)
  @http_response = http_response
end

Instance Method Details

#dataObject



19
20
21
# File 'lib/iwoca/response.rb', line 19

def data
  @http_response.body&.dig(:data) || {}
end

#errorsObject



15
16
17
# File 'lib/iwoca/response.rb', line 15

def errors
  @http_response.body&.dig(:errors) || []
end