Exception: Usps::Imis::Error::Response
- Defined in:
- lib/usps/imis/error/response.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 = {}) ⇒ Response
constructor
A new instance of Response.
- #message ⇒ Object
Constructor Details
#initialize(_message, response, metadata = {}) ⇒ Response
Returns a new instance of Response.
14 15 16 17 |
# File 'lib/usps/imis/error/response.rb', line 14 def initialize(, response, = {}) @response = response super(, ) end |
Instance Attribute Details
#metadata ⇒ Object
Returns the value of attribute metadata.
8 9 10 |
# File 'lib/usps/imis/error/response.rb', line 8 def @metadata end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
7 8 9 |
# File 'lib/usps/imis/error/response.rb', line 7 def response @response end |
Class Method Details
.from(response) ⇒ Object
10 11 12 |
# File 'lib/usps/imis/error/response.rb', line 10 def self.from(response) new(nil, response) end |
Instance Method Details
#bugsnag_meta_data ⇒ Object
19 20 21 |
# File 'lib/usps/imis/error/response.rb', line 19 def .tap { |m| m[:api].merge!() } end |
#message ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/usps/imis/error/response.rb', line 23 def [ "#{self.class.name}: [#{status.to_s.upcase}] The iMIS API returned an error.", (.inspect if != {}), body ].compact.join("\n") end |