Class: BinanceClient::Coin

Inherits:
BaseModel show all
Defined in:
lib/binance_client/models/coin.rb

Constant Summary collapse

STR_METHODS =
%i[
  coin
  name
].freeze
DECIMAL_METHODS =
%i[
  free
  freeze
  ipoable
  ipoing
  locked
  storage
  withdrawing
].freeze
BOOL_MAP =
{
  deposit_all_enable: :deposit_all_enabled?,
  is_legal_money: :legal_money?,
  trading: :trading?,
  withdraw_all_enable: :withdraw_all_enabled?,
}.freeze
METHODS =
(STR_METHODS + DECIMAL_METHODS + BOOL_MAP.keys).freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**kwargs) ⇒ Coin

Returns a new instance of Coin.



31
32
33
34
35
# File 'lib/binance_client/models/coin.rb', line 31

def initialize(**kwargs)
  kwargs.each do |key, value|
    self.send("#{key}=", value)
  end
end

Instance Attribute Details

#raw_hashObject

Returns the value of attribute raw_hash.



28
29
30
# File 'lib/binance_client/models/coin.rb', line 28

def raw_hash
  @raw_hash
end

Instance Method Details

#network_listObject



63
64
65
66
67
# File 'lib/binance_client/models/coin.rb', line 63

def network_list
  @network_list ||= raw_hash["networkList"].map do |network_hash|
    Network.new(raw_hash: network_hash)
  end
end