Exception: PacklinkLite::Error
- Inherits:
-
StandardError
- Object
- StandardError
- PacklinkLite::Error
- Defined in:
- lib/packlink_lite/errors.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#http_body ⇒ Object
readonly
Returns the value of attribute http_body.
-
#http_code ⇒ Object
readonly
Returns the value of attribute http_code.
Instance Method Summary collapse
-
#initialize(message, http_body = nil, http_code = nil) ⇒ Error
constructor
A new instance of Error.
- #inspect ⇒ Object
- #message ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(message, http_body = nil, http_code = nil) ⇒ Error
Returns a new instance of Error.
5 6 7 8 9 |
# File 'lib/packlink_lite/errors.rb', line 5 def initialize(, http_body = nil, http_code = nil) @message = @http_body = http_body @http_code = http_code end |
Instance Attribute Details
#http_body ⇒ Object (readonly)
Returns the value of attribute http_body.
3 4 5 |
# File 'lib/packlink_lite/errors.rb', line 3 def http_body @http_body end |
#http_code ⇒ Object (readonly)
Returns the value of attribute http_code.
3 4 5 |
# File 'lib/packlink_lite/errors.rb', line 3 def http_code @http_code end |
Instance Method Details
#inspect ⇒ Object
11 12 13 |
# File 'lib/packlink_lite/errors.rb', line 11 def inspect "#{}: #{http_body}" end |
#message ⇒ Object
15 16 17 |
# File 'lib/packlink_lite/errors.rb', line 15 def @message || self.class.to_s end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/packlink_lite/errors.rb', line 19 def to_s inspect end |