Exception: Deribit::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Deribit::Error
- Defined in:
- lib/deribit/error.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#msg ⇒ Object
readonly
Returns the value of attribute msg.
Instance Method Summary collapse
-
#initialize(code: nil, json: {}, message: nil) ⇒ Error
constructor
A new instance of Error.
- #inspect ⇒ Object
- #message ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(code: nil, json: {}, message: nil) ⇒ Error
Returns a new instance of Error.
5 6 7 8 |
# File 'lib/deribit/error.rb', line 5 def initialize(code: nil, json: {}, message: nil) @code = code || json[:code] @msg = || json[:msg] end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/deribit/error.rb', line 3 def code @code end |
#msg ⇒ Object (readonly)
Returns the value of attribute msg.
3 4 5 |
# File 'lib/deribit/error.rb', line 3 def msg @msg end |
Instance Method Details
#inspect ⇒ Object
10 11 12 13 14 |
# File 'lib/deribit/error.rb', line 10 def inspect = "" += "(#{code}) " unless code.nil? += "#{msg}" unless msg.nil? end |
#message ⇒ Object
16 17 18 |
# File 'lib/deribit/error.rb', line 16 def inspect end |
#to_s ⇒ Object
20 21 22 |
# File 'lib/deribit/error.rb', line 20 def to_s inspect end |