Class: ChinaShop::Account
- Inherits:
-
Object
- Object
- ChinaShop::Account
- Defined in:
- lib/chinashop/account.rb
Instance Attribute Summary collapse
-
#all ⇒ Object
Returns the value of attribute all.
-
#balance ⇒ Object
Returns the value of attribute balance.
-
#deposit_address ⇒ Object
Returns the value of attribute deposit_address.
-
#frozen ⇒ Object
Returns the value of attribute frozen.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(account = {}) ⇒ Account
constructor
A new instance of Account.
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(account = {}) self.all = account['result'] self.username = account['result']['profile']['username'] self.balance = OpenStruct.new(:btc => account['result']['balance']['btc']['amount'], :cny => account['result']['balance']['cny']['amount']) self.frozen = OpenStruct.new(:btc => account['result']['frozen']['btc']['amount'], :cny => account['result']['frozen']['cny']['amount']) self.deposit_address = account['result']['profile']['btc_deposit_address'] end |
Instance Attribute Details
#all ⇒ Object
Returns the value of attribute all.
5 6 7 |
# File 'lib/chinashop/account.rb', line 5 def all @all end |
#balance ⇒ Object
Returns the value of attribute balance.
5 6 7 |
# File 'lib/chinashop/account.rb', line 5 def balance @balance end |
#deposit_address ⇒ Object
Returns the value of attribute deposit_address.
5 6 7 |
# File 'lib/chinashop/account.rb', line 5 def deposit_address @deposit_address end |
#frozen ⇒ Object
Returns the value of attribute frozen.
5 6 7 |
# File 'lib/chinashop/account.rb', line 5 def frozen @frozen end |
#username ⇒ Object
Returns the value of attribute username.
5 6 7 |
# File 'lib/chinashop/account.rb', line 5 def username @username end |