Exception: InstantQuote::ApiError
- Inherits:
-
StandardError
- Object
- StandardError
- InstantQuote::ApiError
- Defined in:
- lib/instant_quote/api_error.rb
Instance Attribute Summary collapse
-
#adapter ⇒ Object
Returns the value of attribute adapter.
-
#code ⇒ Object
Returns the value of attribute code.
-
#data ⇒ Object
Returns the value of attribute data.
-
#error ⇒ Object
(also: #message, #to_s)
Returns the value of attribute error.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ ApiError
constructor
A new instance of ApiError.
Constructor Details
#initialize(params = {}) ⇒ ApiError
Returns a new instance of ApiError.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/instant_quote/api_error.rb', line 10 def initialize(params = {}) super @adapter = params[:adapter] @error = params[:error] @data = params[:data] || {} @code = params[:code] # Delete the metaData key, because it's irrelevant and has long strings @data.delete(:metaData) if @data.respond_to?(:key?) && @data.key?(:metaData) end |
Instance Attribute Details
#adapter ⇒ Object
Returns the value of attribute adapter.
5 6 7 |
# File 'lib/instant_quote/api_error.rb', line 5 def adapter @adapter end |
#code ⇒ Object
Returns the value of attribute code.
5 6 7 |
# File 'lib/instant_quote/api_error.rb', line 5 def code @code end |
#data ⇒ Object
Returns the value of attribute data.
5 6 7 |
# File 'lib/instant_quote/api_error.rb', line 5 def data @data end |
#error ⇒ Object Also known as: message, to_s
Returns the value of attribute error.
5 6 7 |
# File 'lib/instant_quote/api_error.rb', line 5 def error @error end |