Class: Bitcoiner::AccountHash

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

Instance Method Summary collapse

Constructor Details

#initialize(client, balance_hash) ⇒ AccountHash

Returns a new instance of AccountHash.



5
6
7
8
9
10
# File 'lib/bitcoiner/account_hash.rb', line 5

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

Instance Method Details

#new(name) ⇒ Object



12
13
14
15
16
# File 'lib/bitcoiner/account_hash.rb', line 12

def new(name)
  @client.request 'getnewaddress', name
  self[name] = Account.new @client, name
  self[name]
end