Class: Fastbeans::Response
- Inherits:
-
Object
- Object
- Fastbeans::Response
- Defined in:
- lib/fastbeans/response.rb
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#initialize(call_data, raw_response) ⇒ Response
constructor
A new instance of Response.
- #payload ⇒ Object
- #to_exception ⇒ Object
Constructor Details
#initialize(call_data, raw_response) ⇒ Response
Returns a new instance of Response.
6 7 8 9 |
# File 'lib/fastbeans/response.rb', line 6 def initialize(call_data, raw_response) @call_data = call_data @raw_response = raw_response end |
Instance Method Details
#error? ⇒ Boolean
11 12 13 |
# File 'lib/fastbeans/response.rb', line 11 def error? @raw_response.is_a?(Hash) and @raw_response.has_key?("fastbeans-error") end |
#payload ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/fastbeans/response.rb', line 15 def payload unless error? @raw_response else raise to_exception end end |