Class: BitShares::Wallet
- Inherits:
-
Object
- Object
- BitShares::Wallet
- Defined in:
- lib/bitshares/wallet.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#asset ⇒ Object
Returns the value of attribute asset.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hash) ⇒ Wallet
constructor
A new instance of Wallet.
Constructor Details
#initialize(hash) ⇒ Wallet
Returns a new instance of Wallet.
4 5 6 7 |
# File 'lib/bitshares/wallet.rb', line 4 def initialize hash @amount = hash['amount'] @asset = BitShares::Asset[hash['asset_id']] end |
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
3 4 5 |
# File 'lib/bitshares/wallet.rb', line 3 def amount @amount end |
#asset ⇒ Object
Returns the value of attribute asset.
3 4 5 |
# File 'lib/bitshares/wallet.rb', line 3 def asset @asset end |
Class Method Details
.[](name, *ids) ⇒ Object
10 11 12 |
# File 'lib/bitshares/wallet.rb', line 10 def [] name, *ids RPC.new('get_named_account_balances',[name,ids]).send.inject([]) {|m,a| m << Wallet.new(a) } end |