Exception: JSONAPI::Consumer::Errors::ResponseError
- Inherits:
-
StandardError
- Object
- StandardError
- JSONAPI::Consumer::Errors::ResponseError
- Defined in:
- lib/jsonapi/consumer/errors.rb
Overview
Base subclass for all response errors
Instance Attribute Summary collapse
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(message = nil, response = nil) ⇒ ResponseError
constructor
A new instance of ResponseError.
- #response_body ⇒ Object
Constructor Details
#initialize(message = nil, response = nil) ⇒ ResponseError
Returns a new instance of ResponseError.
44 45 46 47 |
# File 'lib/jsonapi/consumer/errors.rb', line 44 def initialize(=nil, response=nil) super() self.response = response end |
Instance Attribute Details
#response ⇒ Object
Returns the value of attribute response.
42 43 44 |
# File 'lib/jsonapi/consumer/errors.rb', line 42 def response @response end |
Instance Method Details
#errors ⇒ Object
49 50 51 |
# File 'lib/jsonapi/consumer/errors.rb', line 49 def errors response[:body].fetch('errors', []) end |
#response_body ⇒ Object
53 54 55 |
# File 'lib/jsonapi/consumer/errors.rb', line 53 def response_body response[:body] end |