Class: Bitcoind::AccountHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/bitcoind/account_hash.rb

Instance Method Summary collapse

Constructor Details

#initialize(client, balance_hash) ⇒ AccountHash

Returns a new instance of AccountHash.



3
4
5
6
7
8
# File 'lib/bitcoind/account_hash.rb', line 3

def initialize(client, balance_hash)
  @client = client
  balance_hash.each do |name,b|
    self[name] = Account.new client, name
  end
end

Instance Method Details

#new(name) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/bitcoind/account_hash.rb', line 10

def new(name)
  addr = @client.request 'getnewaddress', name

  self[name] = Account.new @client, name

  self[name]
end