Exception: Yooda::APIError
- Inherits:
-
StandardError
- Object
- StandardError
- Yooda::APIError
- Defined in:
- lib/yooda/api_error.rb
Instance Attribute Summary collapse
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(status, reason, response) ⇒ APIError
constructor
A new instance of APIError.
- #message ⇒ Object (also: #to_s)
Constructor Details
#initialize(status, reason, response) ⇒ APIError
Returns a new instance of APIError.
8 9 10 11 12 |
# File 'lib/yooda/api_error.rb', line 8 def initialize(status, reason, response) @status = status @reason = reason @response = response end |
Instance Attribute Details
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
5 6 7 |
# File 'lib/yooda/api_error.rb', line 5 def reason @reason end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
6 7 8 |
# File 'lib/yooda/api_error.rb', line 6 def response @response end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/yooda/api_error.rb', line 4 def status @status end |
Instance Method Details
#message ⇒ Object Also known as: to_s
14 15 16 |
# File 'lib/yooda/api_error.rb', line 14 def "#{@reason}: #{@response} (#{@status})" end |