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, #not_paginatable?, #paginatable?, #success?
Instance Method Details
#body ⇒ Object
11
12
13
|
# File 'lib/bank_exchange_api/response/json.rb', line 11
def body
@body ||= JSON.parse(http.body)
end
|
#data ⇒ Object
27
28
29
|
# File 'lib/bank_exchange_api/response/json.rb', line 27
def data
root ? body[root.to_s] : body
end
|
#inspect ⇒ Object
31
32
33
|
# File 'lib/bank_exchange_api/response/json.rb', line 31
def inspect
body
end
|
#next_page_url ⇒ Object
23
24
25
|
# File 'lib/bank_exchange_api/response/json.rb', line 23
def next_page_url
['next_page_url']
end
|
19
20
21
|
# File 'lib/bank_exchange_api/response/json.rb', line 19
def
body.fetch('pagination', {})
end
|
#params ⇒ Object
15
16
17
|
# File 'lib/bank_exchange_api/response/json.rb', line 15
def params
body.fetch('params', {})
end
|