Class: Coinone::Account::Balance::Wallet

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Wallet

Returns a new instance of Wallet.



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

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

Instance Attribute Details

#availObject (readonly)

Returns the value of attribute avail.



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

def avail
  @avail
end

#balanceObject (readonly)

Returns the value of attribute balance.



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

def balance
  @balance
end

Instance Method Details

#update_wallet(params = {}) ⇒ Object



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

def update_wallet(params={})
  @avail = params[:avail].to_d if params.has_key? :avail
  @balance = params[:balance].to_d if params.has_key? :balance
  # If wanna Full Decimal 
  # => OBJ.to_digits
end