Class: BinanceClient::BaseResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/binance_client/responses/base_response.rb

Instance Method Summary collapse

Instance Method Details

#body_codeObject



20
21
22
23
24
# File 'lib/binance_client/responses/base_response.rb', line 20

def body_code
  val = body["code"]
  return nil if val.nil?
  val.to_i
end

#default_messageObject



16
17
18
# File 'lib/binance_client/responses/base_response.rb', line 16

def default_message
  body["message"].presence || body["msg"]
end

#used_weightsObject



8
9
10
11
12
13
14
# File 'lib/binance_client/responses/base_response.rb', line 8

def used_weights
  @used_weights ||= headers.each_with_object({}) do |(key, value), hash|
    next if not key.include?("USED")
    next if not key.include?("WEIGHT")
    hash[key] = value
  end
end