Exception: ShippingScale::Error
- Inherits:
-
StandardError
- Object
- StandardError
- ShippingScale::Error
- Defined in:
- lib/shipping_scale/error.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(message, code, source) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(message, code, source) ⇒ Error
Returns a new instance of Error.
5 6 7 8 9 10 |
# File 'lib/shipping_scale/error.rb', line 5 def initialize(, code, source) super() @code = code @source = source end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/shipping_scale/error.rb', line 3 def code @code end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
3 4 5 |
# File 'lib/shipping_scale/error.rb', line 3 def source @source end |
Class Method Details
.for_code(code) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/shipping_scale/error.rb', line 13 def for_code(code) case code when "-2147219498" ; AuthorizationError when "-2147219100" ; MissingZipOriginError when "-2147219099" ; MissingZipDestinationError when "-2147219497" ; InvalidZipDestinationError when "-2147219498" ; InvalidZipOriginError when "-2147219097" ; MissingWeightError when "-2147219098" ; MissingWeightError else ; Error end end |