Exception: Sense::APIError
- Inherits:
-
StandardError
- Object
- StandardError
- Sense::APIError
- Defined in:
- lib/hello_sense/api_error.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(response) ⇒ APIError
constructor
A new instance of APIError.
- #message ⇒ Object (also: #to_s)
Constructor Details
#initialize(response) ⇒ APIError
TODO:
Document param
Returns a new instance of APIError.
8 9 10 11 12 13 |
# File 'lib/hello_sense/api_error.rb', line 8 def initialize(response) @code = response.code @description = response.code_type @response = response @type = response.error_type end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
5 6 7 |
# File 'lib/hello_sense/api_error.rb', line 5 def code @code end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
5 6 7 |
# File 'lib/hello_sense/api_error.rb', line 5 def description @description end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
5 6 7 |
# File 'lib/hello_sense/api_error.rb', line 5 def response @response end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/hello_sense/api_error.rb', line 5 def type @type end |
Instance Method Details
#message ⇒ Object Also known as: to_s
15 16 17 |
# File 'lib/hello_sense/api_error.rb', line 15 def "#{@type}: #{@description} (#{@code})" end |