Exception: Imis::Error::Api
- Inherits:
-
StandardError
- Object
- StandardError
- Imis::Error::Api
- Defined in:
- lib/imis/error/api.rb
Instance Attribute Summary collapse
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Class Method Summary collapse
Instance Method Summary collapse
- #bugsnag_meta_data ⇒ Object
-
#initialize(message, response, metadata = {}) ⇒ Api
constructor
A new instance of Api.
Constructor Details
#initialize(message, response, metadata = {}) ⇒ Api
Returns a new instance of Api.
13 14 15 16 17 |
# File 'lib/imis/error/api.rb', line 13 def initialize(, response, = {}) super() @metadata = @response = response end |
Instance Attribute Details
#metadata ⇒ Object
Returns the value of attribute metadata.
7 8 9 |
# File 'lib/imis/error/api.rb', line 7 def @metadata end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
6 7 8 |
# File 'lib/imis/error/api.rb', line 6 def response @response end |
Class Method Details
.from(response) ⇒ Object
9 10 11 |
# File 'lib/imis/error/api.rb', line 9 def self.from(response) new('The iMIS API returned an error.', response) end |
Instance Method Details
#bugsnag_meta_data ⇒ Object
19 20 21 |
# File 'lib/imis/error/api.rb', line 19 def { api: { status: status, body: body }.merge!() } end |