Exception: Anilibria::Api::Exceptions::ApiError
- Inherits:
-
ResponseError
- Object
- StandardError
- Base
- ResponseError
- Anilibria::Api::Exceptions::ApiError
- Defined in:
- lib/anilibria/api/exceptions/api_error.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Attributes inherited from ResponseError
Instance Method Summary collapse
-
#initialize(response) ⇒ ApiError
constructor
A new instance of ApiError.
Constructor Details
#initialize(response) ⇒ ApiError
Returns a new instance of ApiError.
7 8 9 10 11 12 |
# File 'lib/anilibria/api/exceptions/api_error.rb', line 7 def initialize(response) error = response.body[:error].to_h @code = error[:code] super(error[:message], response) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
5 6 7 |
# File 'lib/anilibria/api/exceptions/api_error.rb', line 5 def code @code end |