Class: BankExchangeApi::Response::Base
- Inherits:
-
Object
- Object
- BankExchangeApi::Response::Base
- Defined in:
- lib/bank_exchange_api/response/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#http ⇒ Object
readonly
Returns the value of attribute http.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
-
#body ⇒ Object
Response body.
-
#data ⇒ Object
Response payload data User root param to access the data.
-
#initialize(http, root: nil) ⇒ Base
constructor
A new instance of Base.
- #next_page_url ⇒ Object
- #not_paginatable? ⇒ Boolean
- #paginatable? ⇒ Boolean
- #pagination ⇒ Object
-
#params ⇒ Object
Request params in responce.
- #success? ⇒ Boolean
Constructor Details
Instance Attribute Details
#http ⇒ Object (readonly)
Returns the value of attribute http.
3 4 5 |
# File 'lib/bank_exchange_api/response/base.rb', line 3 def http @http end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
3 4 5 |
# File 'lib/bank_exchange_api/response/base.rb', line 3 def root @root end |
Instance Method Details
#body ⇒ Object
Response body
32 33 34 |
# File 'lib/bank_exchange_api/response/base.rb', line 32 def body raise NotImplementedError, __method__ end |
#data ⇒ Object
Response payload data User root param to access the data
18 19 20 |
# File 'lib/bank_exchange_api/response/base.rb', line 18 def data raise NotImplementedError, __method__ end |
#next_page_url ⇒ Object
40 41 42 |
# File 'lib/bank_exchange_api/response/base.rb', line 40 def next_page_url raise NotImplementedError, __method__ end |
#not_paginatable? ⇒ Boolean
48 49 50 |
# File 'lib/bank_exchange_api/response/base.rb', line 48 def not_paginatable? !paginatable? end |
#paginatable? ⇒ Boolean
44 45 46 |
# File 'lib/bank_exchange_api/response/base.rb', line 44 def paginatable? !next_page_url.nil? end |
#pagination ⇒ Object
36 37 38 |
# File 'lib/bank_exchange_api/response/base.rb', line 36 def pagination raise NotImplementedError, __method__ end |
#params ⇒ Object
Request params in responce
25 26 27 |
# File 'lib/bank_exchange_api/response/base.rb', line 25 def params raise NotImplementedError, __method__ end |
#success? ⇒ Boolean
10 11 12 |
# File 'lib/bank_exchange_api/response/base.rb', line 10 def success? http.code.to_i == 200 end |