Exception: Antbird::Client::ApiError
- Defined in:
- lib/antbird/client/errors.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(response) ⇒ ApiError
constructor
A new instance of ApiError.
Constructor Details
#initialize(response) ⇒ ApiError
Returns a new instance of ApiError.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/antbird/client/errors.rb', line 6 def initialize(response) @response = response @status = response.status body = response.body @error = body["error"] if body.is_a?(Hash) && body.key?("error") = @error || body.to_s super end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
16 17 18 |
# File 'lib/antbird/client/errors.rb', line 16 def response @response end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
16 17 18 |
# File 'lib/antbird/client/errors.rb', line 16 def status @status end |