Exception: USPS::Error
- Inherits:
-
StandardError
- Object
- StandardError
- USPS::Error
- Defined in:
- lib/usps/errors.rb
Overview
Error Hierarchy
StandardError
USPS::Error
USPS::AuthorizationError
USPS::ValidationError
USPS::InvalidCityError
USPS::InvalidStateError
USPS::AddressNotFoundError
USPS::MultipleAddressError
USPS::InvalidImageTypeError
Direct Known Subclasses
Instance Attribute Summary collapse
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(message, number, source) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(message, number, source) ⇒ Error
Returns a new instance of Error.
16 17 18 19 20 21 |
# File 'lib/usps/errors.rb', line 16 def initialize(, number, source) super() @number = number @source = source end |
Instance Attribute Details
#number ⇒ Object (readonly)
Returns the value of attribute number.
14 15 16 |
# File 'lib/usps/errors.rb', line 14 def number @number end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
14 15 16 |
# File 'lib/usps/errors.rb', line 14 def source @source end |
Class Method Details
.for_code(code) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/usps/errors.rb', line 24 def for_code(code) case code when '80040b1a' ; AuthorizationError when '-2147219400'; InvalidCityError when '-2147219401'; AddressNotFoundError when '-2147219402'; InvalidStateError when '-2147219403'; MultipleAddressError when '-2147218900'; InvalidImageTypeError else ; Error end end |