Class: Coinone::Account::DailyBalance
- Inherits:
-
Object
- Object
- Coinone::Account::DailyBalance
- Defined in:
- lib/coinone/account/daily_balance.rb,
lib/coinone/account/daily_balance/balance.rb
Defined Under Namespace
Classes: Balance
Instance Attribute Summary collapse
-
#daily_balances ⇒ Object
readonly
Returns the value of attribute daily_balances.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ DailyBalance
constructor
A new instance of DailyBalance.
- #update_balance(params = {}) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ DailyBalance
Returns a new instance of DailyBalance.
12 13 14 15 16 17 18 19 20 |
# File 'lib/coinone/account/daily_balance.rb', line 12 def initialize(={}) @result = [:result] || nil @daily_balances = [] update_balance() if .has_key? :dailyBalance end |
Instance Attribute Details
#daily_balances ⇒ Object (readonly)
Returns the value of attribute daily_balances.
10 11 12 |
# File 'lib/coinone/account/daily_balance.rb', line 10 def daily_balances @daily_balances end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
9 10 11 |
# File 'lib/coinone/account/daily_balance.rb', line 9 def result @result end |
Instance Method Details
#update_balance(params = {}) ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/coinone/account/daily_balance.rb', line 22 def update_balance(params={}) @result = params[:result] if params.has_key? :result if params.has_key? :dailyBalance @daily_balances.clear params[:dailyBalance].each do |balance| @daily_balances.push(Balance.new(balance)) end end end |