Class: Bibox::Models::UserAssets

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

Constant Summary collapse

MAPPING =
{
  total_btc:      :float,
  total_cny:      :float,
  total_usd:      :float,
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#attributes, parse

Constructor Details

#initialize(hash) ⇒ UserAssets

Returns a new instance of UserAssets.



12
13
14
15
# File 'lib/bibox/models/user_assets.rb', line 12

def initialize(hash)
  super(hash)
  process(hash.fetch("assets_list", []))
end

Instance Attribute Details

#assetsObject

Returns the value of attribute assets.



4
5
6
# File 'lib/bibox/models/user_assets.rb', line 4

def assets
  @assets
end

Instance Method Details

#process(assets) ⇒ Object



17
18
19
# File 'lib/bibox/models/user_assets.rb', line 17

def process(assets)
  self.assets   =   ::Bibox::Models::Asset.parse(assets)
end