Exception: Shippo::Exceptions::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Shippo::Exceptions::Error
- Defined in:
- lib/shippo/exceptions/error.rb
Direct Known Subclasses
APIError, AbstractClassInitError, AuthenticationError, ConnectionError, MissingDataError
Instance Attribute Summary collapse
-
#message ⇒ Object
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(thing = nil) ⇒ Error
constructor
A new instance of Error.
- #to_s ⇒ Object
- #to_s_members ⇒ Object
Constructor Details
#initialize(thing = nil) ⇒ Error
Returns a new instance of Error.
7 8 9 10 11 12 13 14 15 |
# File 'lib/shippo/exceptions/error.rb', line 7 def initialize(thing = nil) if thing.is_a?(String) self. = thing elsif thing.respond_to?(:message) self. = thing. else super(thing) end end |
Instance Attribute Details
#message ⇒ Object
Returns the value of attribute message.
5 6 7 |
# File 'lib/shippo/exceptions/error.rb', line 5 def @message end |
Instance Method Details
#to_s ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/shippo/exceptions/error.rb', line 21 def to_s out = super out << " (#{}) " if to_s_members.each do |member| out << member_to_s(member) end out end |
#to_s_members ⇒ Object
17 18 19 |
# File 'lib/shippo/exceptions/error.rb', line 17 def to_s_members %i() end |