Exception: Usps::Imis::Error::Api
- Inherits:
-
StandardError
- Object
- StandardError
- Usps::Imis::Error::Api
- Defined in:
- lib/usps/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.
14 15 16 17 18 |
# File 'lib/usps/imis/error/api.rb', line 14 def initialize(, response, = {}) super() @metadata = @response = response end |
Instance Attribute Details
#metadata ⇒ Object
Returns the value of attribute metadata.
8 9 10 |
# File 'lib/usps/imis/error/api.rb', line 8 def @metadata end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
7 8 9 |
# File 'lib/usps/imis/error/api.rb', line 7 def response @response end |
Class Method Details
.from(response) ⇒ Object
10 11 12 |
# File 'lib/usps/imis/error/api.rb', line 10 def self.from(response) new('The iMIS API returned an error.', response) end |
Instance Method Details
#bugsnag_meta_data ⇒ Object
20 21 22 |
# File 'lib/usps/imis/error/api.rb', line 20 def { api: { status: status, body: body }.merge!() } end |