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.
-
#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 |
#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 |