Class: Iwoca::Response
- Inherits:
-
Object
- Object
- Iwoca::Response
- Extended by:
- Forwardable
- Defined in:
- lib/iwoca/response.rb
Instance Method Summary collapse
- #data ⇒ Object
- #errors ⇒ Object
-
#initialize(http_response) ⇒ Response
constructor
A new instance of Response.
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
#data ⇒ Object
19 20 21 |
# File 'lib/iwoca/response.rb', line 19 def data @http_response.body&.dig(:data) || {} end |
#errors ⇒ Object
15 16 17 |
# File 'lib/iwoca/response.rb', line 15 def errors @http_response.body&.dig(:errors) || [] end |