Class: Bibox::Models::Asset

Inherits:
Base
  • Object
show all
Defined in:
lib/bibox/models/asset.rb

Constant Summary collapse

MAPPING =
{
  id:                 :string,
  symbol:             :string,
  icon_url:           :string,
  describe_url:       :string,
  name:               :string,
  enable_withdraw:    :boolean,
  enable_deposit:     :boolean,
  confirm_count:      :integer,
  total_balance:      :float,
  balance:            :float,
  freeze:             :float,
  btc_value:          :float,
  cny_value:          :float,
  usd_value:          :float
}

Instance Method Summary collapse

Methods inherited from Base

#attributes, parse

Constructor Details

#initialize(hash) ⇒ Asset

Returns a new instance of Asset.



21
22
23
24
25
# File 'lib/bibox/models/asset.rb', line 21

def initialize(hash)
  super(hash)
  
  self.symbol   =   hash.fetch("coin_symbol", nil) if self.symbol.to_s.empty? && hash.has_key?("coin_symbol")
end