Class: Coinbase::Wallet::APIResponse
- Inherits:
-
Object
- Object
- Coinbase::Wallet::APIResponse
- Defined in:
- lib/coinbase/wallet/api_response.rb
Overview
Encapsulate data for an API response
Direct Known Subclasses
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#method ⇒ Object
Returns the value of attribute method.
-
#params ⇒ Object
Returns the value of attribute params.
-
#received_at ⇒ Object
readonly
Returns the value of attribute received_at.
Instance Method Summary collapse
- #body ⇒ Object (also: #data)
- #body=(body) ⇒ Object
- #has_more? ⇒ Boolean
- #headers ⇒ Object
-
#initialize(resp) ⇒ APIResponse
constructor
A new instance of APIResponse.
- #raw ⇒ Object
- #status ⇒ Object
Constructor Details
#initialize(resp) ⇒ APIResponse
Returns a new instance of APIResponse.
10 11 12 13 |
# File 'lib/coinbase/wallet/api_response.rb', line 10 def initialize(resp) @received_at = Time.now @response = resp end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
6 7 8 |
# File 'lib/coinbase/wallet/api_response.rb', line 6 def client @client end |
#method ⇒ Object
Returns the value of attribute method.
7 8 9 |
# File 'lib/coinbase/wallet/api_response.rb', line 7 def method @method end |
#params ⇒ Object
Returns the value of attribute params.
8 9 10 |
# File 'lib/coinbase/wallet/api_response.rb', line 8 def params @params end |
#received_at ⇒ Object (readonly)
Returns the value of attribute received_at.
5 6 7 |
# File 'lib/coinbase/wallet/api_response.rb', line 5 def received_at @received_at end |
Instance Method Details
#body ⇒ Object Also known as: data
19 20 21 |
# File 'lib/coinbase/wallet/api_response.rb', line 19 def body raise NotImplementedError end |
#body=(body) ⇒ Object
24 25 26 |
# File 'lib/coinbase/wallet/api_response.rb', line 24 def body=(body) raise NotImplementedError end |
#has_more? ⇒ Boolean
36 37 38 |
# File 'lib/coinbase/wallet/api_response.rb', line 36 def has_more? body.has_key?('pagination') && body['pagination']['next_uri'] != nil end |
#headers ⇒ Object
28 29 30 |
# File 'lib/coinbase/wallet/api_response.rb', line 28 def headers raise NotImplementedError end |
#raw ⇒ Object
15 16 17 |
# File 'lib/coinbase/wallet/api_response.rb', line 15 def raw @response end |
#status ⇒ Object
32 33 34 |
# File 'lib/coinbase/wallet/api_response.rb', line 32 def status raise NotImplementedError end |