Class: Cryptoprocessing::APIResponse
- Inherits:
-
Object
- Object
- Cryptoprocessing::APIResponse
- Defined in:
- lib/cryptoprocessing/client/api_response.rb
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.
8 9 10 11 |
# File 'lib/cryptoprocessing/client/api_response.rb', line 8 def initialize(resp) @received_at = Time.now @response = resp end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
4 5 6 |
# File 'lib/cryptoprocessing/client/api_response.rb', line 4 def client @client end |
#method ⇒ Object
Returns the value of attribute method.
5 6 7 |
# File 'lib/cryptoprocessing/client/api_response.rb', line 5 def method @method end |
#params ⇒ Object
Returns the value of attribute params.
6 7 8 |
# File 'lib/cryptoprocessing/client/api_response.rb', line 6 def params @params end |
#received_at ⇒ Object (readonly)
Returns the value of attribute received_at.
3 4 5 |
# File 'lib/cryptoprocessing/client/api_response.rb', line 3 def received_at @received_at end |
Instance Method Details
#body ⇒ Object Also known as: data
17 18 19 |
# File 'lib/cryptoprocessing/client/api_response.rb', line 17 def body raise NotImplementedError end |
#body=(body) ⇒ Object
23 24 25 |
# File 'lib/cryptoprocessing/client/api_response.rb', line 23 def body=(body) raise NotImplementedError end |
#has_more? ⇒ Boolean
35 36 37 |
# File 'lib/cryptoprocessing/client/api_response.rb', line 35 def has_more? body.has_key?('pagination') && body['pagination']['next_uri'] != nil end |
#headers ⇒ Object
27 28 29 |
# File 'lib/cryptoprocessing/client/api_response.rb', line 27 def headers raise NotImplementedError end |
#raw ⇒ Object
13 14 15 |
# File 'lib/cryptoprocessing/client/api_response.rb', line 13 def raw @response end |
#status ⇒ Object
31 32 33 |
# File 'lib/cryptoprocessing/client/api_response.rb', line 31 def status raise NotImplementedError end |