Class: BitShares::Account
- Inherits:
-
Object
- Object
- BitShares::Account
- Defined in:
- lib/bitshares/account.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #balance(*ids) ⇒ Object
-
#initialize(h) ⇒ Account
constructor
A new instance of Account.
- #to_s ⇒ Object
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
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/bitshares/account.rb', line 3 def id @id end |
#name ⇒ Object (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_s ⇒ Object
11 |
# File 'lib/bitshares/account.rb', line 11 def to_s() @name end |