Class: Usps::Api::Errors::UspsError
- Inherits:
-
Faraday::Error
- Object
- Faraday::Error
- Usps::Api::Errors::UspsError
- Defined in:
- lib/usps/api/errors/usps_error.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #error ⇒ Object
- #errors ⇒ Object
-
#initialize(error, response = nil) ⇒ UspsError
constructor
A new instance of UspsError.
- #response_metadata ⇒ Object
Constructor Details
#initialize(error, response = nil) ⇒ UspsError
Returns a new instance of UspsError.
8 9 10 11 12 13 14 |
# File 'lib/usps/api/errors/usps_error.rb', line 8 def initialize(error, response = nil) super error['Description'] @error_number = error['Number'] @error_description = error['Description'] @error_source = error['Source'] @response = response end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
6 7 8 |
# File 'lib/usps/api/errors/usps_error.rb', line 6 def response @response end |
Instance Method Details
#error ⇒ Object
16 17 18 |
# File 'lib/usps/api/errors/usps_error.rb', line 16 def error response.body.error end |
#errors ⇒ Object
20 21 22 |
# File 'lib/usps/api/errors/usps_error.rb', line 20 def errors response.body.errors end |
#response_metadata ⇒ Object
24 25 26 |
# File 'lib/usps/api/errors/usps_error.rb', line 24 def response.body. end |