Class: Coinone::Account::Balance::Wallet
- Inherits:
-
Object
- Object
- Coinone::Account::Balance::Wallet
- Defined in:
- lib/coinone/account/balance/wallet.rb
Instance Attribute Summary collapse
-
#avail ⇒ Object
readonly
Returns the value of attribute avail.
-
#balance ⇒ Object
readonly
Returns the value of attribute balance.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Wallet
constructor
A new instance of Wallet.
- #update_wallet(params = {}) ⇒ Object
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
#avail ⇒ Object (readonly)
Returns the value of attribute avail.
6 7 8 |
# File 'lib/coinone/account/balance/wallet.rb', line 6 def avail @avail end |
#balance ⇒ Object (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 |