Class: BitWallet::Address

Inherits:
Object
  • Object
show all
Defined in:
lib/bit_wallet/address.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account, address = nil) ⇒ Address

Returns a new instance of Address.



8
9
10
11
12
13
14
15
# File 'lib/bit_wallet/address.rb', line 8

def initialize(, address=nil)
  @account = 
  @address = if address
               address
             else
               client.getnewaddress(@account.name)
             end
end

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account.



4
5
6
# File 'lib/bit_wallet/address.rb', line 4

def 
  @account
end

#addressObject (readonly)

Returns the value of attribute address.



4
5
6
# File 'lib/bit_wallet/address.rb', line 4

def address
  @address
end

Instance Method Details

#==(other_address) ⇒ Object



21
22
23
# File 'lib/bit_wallet/address.rb', line 21

def ==(other_address)
  self.address == other_address.address
end

#total_receivedObject



17
18
19
# File 'lib/bit_wallet/address.rb', line 17

def total_received
  client.getreceivedbyaddress(self.address, BitWallet.min_conf)
end