Class: Pastvu::BasicResponse
- Inherits:
-
Object
- Object
- Pastvu::BasicResponse
- Defined in:
- lib/pastvu/basic_response.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#hash ⇒ Object
Returns the value of attribute hash.
-
#json ⇒ Object
Returns the value of attribute json.
Instance Method Summary collapse
-
#initialize(response_body) ⇒ BasicResponse
constructor
A new instance of BasicResponse.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(response_body) ⇒ BasicResponse
Returns a new instance of BasicResponse.
5 6 7 8 9 10 11 |
# File 'lib/pastvu/basic_response.rb', line 5 def initialize(response_body) @json = response_body if Pastvu.config.ensure_successful_responses @hash = self.to_hash raise RuntimeError, "Unexpected response from the server: #{@hash}" unless @hash["result"] end end |
Instance Attribute Details
#hash ⇒ Object
Returns the value of attribute hash.
3 4 5 |
# File 'lib/pastvu/basic_response.rb', line 3 def hash @hash end |
#json ⇒ Object
Returns the value of attribute json.
3 4 5 |
# File 'lib/pastvu/basic_response.rb', line 3 def json @json end |