Class: Coinone::Account::Balance::NormalWallet

Inherits:
Object
  • Object
show all
Defined in:
lib/coinone/account/balance/normal_wallet.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ NormalWallet

Returns a new instance of NormalWallet.



8
9
10
11
12
# File 'lib/coinone/account/balance/normal_wallet.rb', line 8

def initialize(params={})
  @balance = nil
  @label = nil
  update_wallet(params)
end

Instance Attribute Details

#balanceObject (readonly)

Returns the value of attribute balance.



6
7
8
# File 'lib/coinone/account/balance/normal_wallet.rb', line 6

def balance
  @balance
end

#labelObject (readonly)

Returns the value of attribute label.



6
7
8
# File 'lib/coinone/account/balance/normal_wallet.rb', line 6

def label
  @label
end

Instance Method Details

#update_wallet(params = {}) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/coinone/account/balance/normal_wallet.rb', line 14

def update_wallet(params={})
  @balance = params[:balance].to_d if params.has_key? :balance
  @balance = params[:label] if params.has_key? :label

  # If wanna Full Decimal 
  # => OBJ.to_digits
end