Class: BankExchangeApi::Response::Json
- Inherits:
-
Base
- Object
- Base
- BankExchangeApi::Response::Json
show all
- Extended by:
- Forwardable
- Defined in:
- lib/bank_exchange_api/response/json.rb
Instance Attribute Summary
Attributes inherited from Base
#http, #root
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #success?
Instance Method Details
#body ⇒ Object
10
11
12
|
# File 'lib/bank_exchange_api/response/json.rb', line 10
def body
@body ||= JSON.parse(http.body)
end
|
#data ⇒ Object
18
19
20
|
# File 'lib/bank_exchange_api/response/json.rb', line 18
def data
root ? body[root.to_s] : body
end
|
#inspect ⇒ Object
22
23
24
|
# File 'lib/bank_exchange_api/response/json.rb', line 22
def inspect
data
end
|
#params ⇒ Object
14
15
16
|
# File 'lib/bank_exchange_api/response/json.rb', line 14
def params
body.fetch('params', {})
end
|