Exception: Edmunds::Api::Exception
- Inherits:
-
StandardError
- Object
- StandardError
- Edmunds::Api::Exception
- Defined in:
- lib/edmunds/api.rb
Instance Attribute Summary collapse
-
#error_type ⇒ Object
readonly
Returns the value of attribute error_type.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(response) ⇒ Exception
constructor
A new instance of Exception.
Constructor Details
#initialize(response) ⇒ Exception
Returns a new instance of Exception.
21 22 23 24 25 26 |
# File 'lib/edmunds/api.rb', line 21 def initialize(response) error = JSON.parse(response.body) @error_type = error['errorType'] @message = error['message'] end |
Instance Attribute Details
#error_type ⇒ Object (readonly)
Returns the value of attribute error_type.
20 21 22 |
# File 'lib/edmunds/api.rb', line 20 def error_type @error_type end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
20 21 22 |
# File 'lib/edmunds/api.rb', line 20 def @message end |