Class: BitShares::Wallet

Inherits:
Object
  • Object
show all
Defined in:
lib/bitshares/wallet.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#amountObject

Returns the value of attribute amount.



3
4
5
# File 'lib/bitshares/wallet.rb', line 3

def amount
  @amount
end

#assetObject

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