Class: Coinone::Account
- Inherits:
-
Object
- Object
- Coinone::Account
- Defined in:
- lib/coinone/account.rb,
lib/coinone/account/balance.rb,
lib/coinone/account/account_info.rb,
lib/coinone/account/daily_balance.rb,
lib/coinone/account/balance/wallet.rb,
lib/coinone/account/deposit_address.rb,
lib/coinone/account/virtual_account.rb,
lib/coinone/account/balance/normal_wallet.rb,
lib/coinone/account/daily_balance/balance.rb,
lib/coinone/account/account_info/bank_info.rb,
lib/coinone/account/account_info/fee_rates.rb,
lib/coinone/account/deposit_address/wallet.rb,
lib/coinone/account/account_info/email_info.rb,
lib/coinone/account/account_info/mobile_info.rb,
lib/coinone/account/account_info/fee_rates/fee_rate.rb,
lib/coinone/account/account_info/virtual_account_info.rb
Defined Under Namespace
Classes: AccountInfo, Balance, DailyBalance, DepositAddress, VirtualAccount
Instance Attribute Summary collapse
-
#account_info ⇒ Object
readonly
Returns the value of attribute account_info.
-
#balance ⇒ Object
readonly
Returns the value of attribute balance.
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#daily_balance ⇒ Object
readonly
Returns the value of attribute daily_balance.
-
#deposit_address ⇒ Object
readonly
Returns the value of attribute deposit_address.
-
#virtual_account ⇒ Object
readonly
Returns the value of attribute virtual_account.
Instance Method Summary collapse
- #get_balance ⇒ Object
- #get_daily_balance ⇒ Object
- #get_deposit_address ⇒ Object
- #get_user_info ⇒ Object
- #get_virtual_account ⇒ Object
-
#initialize(options = {}, connection = nil) ⇒ Account
constructor
A new instance of Account.
Constructor Details
#initialize(options = {}, connection = nil) ⇒ Account
Returns a new instance of Account.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/coinone/account.rb', line 14 def initialize(={}, connection=nil) @connection = connection || Connection.factory() @account_info = AccountInfo.new() @balance = Balance.new() @daily_balance = DailyBalance.new() @deposit_address = DepositAddress.new() @virtual_account = VirtualAccount.new() end |
Instance Attribute Details
#account_info ⇒ Object (readonly)
Returns the value of attribute account_info.
12 13 14 |
# File 'lib/coinone/account.rb', line 12 def account_info @account_info end |
#balance ⇒ Object (readonly)
Returns the value of attribute balance.
12 13 14 |
# File 'lib/coinone/account.rb', line 12 def balance @balance end |
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
11 12 13 |
# File 'lib/coinone/account.rb', line 11 def connection @connection end |
#daily_balance ⇒ Object (readonly)
Returns the value of attribute daily_balance.
12 13 14 |
# File 'lib/coinone/account.rb', line 12 def daily_balance @daily_balance end |
#deposit_address ⇒ Object (readonly)
Returns the value of attribute deposit_address.
12 13 14 |
# File 'lib/coinone/account.rb', line 12 def deposit_address @deposit_address end |
#virtual_account ⇒ Object (readonly)
Returns the value of attribute virtual_account.
12 13 14 |
# File 'lib/coinone/account.rb', line 12 def virtual_account @virtual_account end |
Instance Method Details
#get_balance ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/coinone/account.rb', line 34 def get_balance response = @connection.post("/v2/account/balance/") @balance.update_balance(response) @balance end |
#get_daily_balance ⇒ Object
43 44 45 46 47 48 49 50 |
# File 'lib/coinone/account.rb', line 43 def get_daily_balance response = @connection.post("/v2/account/daily_balance/") @daily_balance.update_balance(response) @daily_balance end |
#get_deposit_address ⇒ Object
52 53 54 55 56 57 58 59 |
# File 'lib/coinone/account.rb', line 52 def get_deposit_address response = @connection.post("/v2/account/deposit_address/") @deposit_address.update_address(response) @deposit_address end |
#get_user_info ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/coinone/account.rb', line 26 def get_user_info response = @connection.post( "/v2/account/user_info/") @account_info.update_user_info(response) @account_info end |
#get_virtual_account ⇒ Object
61 62 63 64 65 66 67 68 |
# File 'lib/coinone/account.rb', line 61 def get_virtual_account response = @connection.post("/v2/account/virtual_account/") @virtual_account.update_virtual_account(response) @virtual_account end |