Class: BitShares::Account

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(h) ⇒ Account

Returns a new instance of Account.



5
6
7
8
9
# File 'lib/bitshares/account.rb', line 5

def initialize h
	@id = h['id'][/\d*$/]
	@name = h['name']
	@hash = h
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

Class Method Details

.[](name) ⇒ Object



18
19
20
# File 'lib/bitshares/account.rb', line 18

def [] name
	new RPC.new('get_account_by_name',[name]).send
end

Instance Method Details

#balance(*ids) ⇒ Object



13
14
15
# File 'lib/bitshares/account.rb', line 13

def balance *ids
	Wallet[@name,*ids]
end

#to_sObject



11
# File 'lib/bitshares/account.rb', line 11

def to_s() @name end