Class: ChinaShop::Account

Inherits:
Object
  • Object
show all
Defined in:
lib/chinashop/account.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account = {}) ⇒ Account

Returns a new instance of Account.



7
8
9
10
11
12
13
# File 'lib/chinashop/account.rb', line 7

def initialize( = {})
  self.all      = ['result']
  self.username = ['result']['profile']['username']
  self.balance  = OpenStruct.new(:btc => ['result']['balance']['btc']['amount'], :cny => ['result']['balance']['cny']['amount'])
  self.frozen   = OpenStruct.new(:btc => ['result']['frozen']['btc']['amount'], :cny => ['result']['frozen']['cny']['amount'])
  self.deposit_address = ['result']['profile']['btc_deposit_address']
end

Instance Attribute Details

#allObject

Returns the value of attribute all.



5
6
7
# File 'lib/chinashop/account.rb', line 5

def all
  @all
end

#balanceObject

Returns the value of attribute balance.



5
6
7
# File 'lib/chinashop/account.rb', line 5

def balance
  @balance
end

#deposit_addressObject

Returns the value of attribute deposit_address.



5
6
7
# File 'lib/chinashop/account.rb', line 5

def deposit_address
  @deposit_address
end

#frozenObject

Returns the value of attribute frozen.



5
6
7
# File 'lib/chinashop/account.rb', line 5

def frozen
  @frozen
end

#usernameObject

Returns the value of attribute username.



5
6
7
# File 'lib/chinashop/account.rb', line 5

def username
  @username
end