Exception: Binance::Api::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Binance::Api::Error
- Defined in:
- lib/binance/api/error.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#msg ⇒ Object
readonly
Returns the value of attribute msg.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(code: nil, json: {}, message: nil, symbol: nil) ⇒ Error
constructor
A new instance of Error.
- #inspect ⇒ Object
- #message ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(code: nil, json: {}, message: nil, symbol: nil) ⇒ Error
Returns a new instance of Error.
13 14 15 16 17 |
# File 'lib/binance/api/error.rb', line 13 def initialize(code: nil, json: {}, message: nil, symbol: nil) @code = code || json[:code] @msg = || json[:msg] @symbol = || json[:symbol] end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
4 5 6 |
# File 'lib/binance/api/error.rb', line 4 def code @code end |
#msg ⇒ Object (readonly)
Returns the value of attribute msg.
4 5 6 |
# File 'lib/binance/api/error.rb', line 4 def msg @msg end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
4 5 6 |
# File 'lib/binance/api/error.rb', line 4 def symbol @symbol end |
Class Method Details
.is_error_response?(response:) ⇒ Boolean
8 9 10 |
# File 'lib/binance/api/error.rb', line 8 def is_error_response?(response:) response.code >= 400 end |
Instance Method Details
#inspect ⇒ Object
19 20 21 22 23 |
# File 'lib/binance/api/error.rb', line 19 def inspect = "" += "(#{code}) " unless code.nil? += "#{msg}" unless msg.nil? end |
#message ⇒ Object
25 26 27 |
# File 'lib/binance/api/error.rb', line 25 def inspect end |
#to_s ⇒ Object
29 30 31 |
# File 'lib/binance/api/error.rb', line 29 def to_s inspect end |