Class: Bitcoind::Account
- Inherits:
-
Object
- Object
- Bitcoind::Account
- Extended by:
- ActiveSupport::Memoizable
- Defined in:
- lib/bitcoind/account.rb
Instance Attribute Summary collapse
-
#balance ⇒ Object
Returns the value of attribute balance.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #address ⇒ Object
-
#initialize(client, name) ⇒ Account
constructor
A new instance of Account.
- #inspect ⇒ Object
- #send_to(destination, amount) ⇒ Object
- #transactions ⇒ Object
Constructor Details
#initialize(client, name) ⇒ Account
Returns a new instance of Account.
6 7 8 9 |
# File 'lib/bitcoind/account.rb', line 6 def initialize(client, name) @client = client self.name = name end |
Instance Attribute Details
#balance ⇒ Object
Returns the value of attribute balance.
4 5 6 |
# File 'lib/bitcoind/account.rb', line 4 def balance @balance end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/bitcoind/account.rb', line 4 def name @name end |
Instance Method Details
#address ⇒ Object
25 26 27 |
# File 'lib/bitcoind/account.rb', line 25 def address @client.request 'getaccountaddress', self.name end |
#inspect ⇒ Object
11 12 13 |
# File 'lib/bitcoind/account.rb', line 11 def inspect "#<Bitcoind::Account #{self.name.inspect} >" end |
#send_to(destination, amount) ⇒ Object
15 16 17 18 |
# File 'lib/bitcoind/account.rb', line 15 def send_to(destination, amount) txn_id = @client.request 'sendfrom', self.name, destination, amount Transaction.new @clientm, self, txn_id end |
#transactions ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/bitcoind/account.rb', line 30 def transactions txn_array = @client.request 'listtransactions', self.name txn_array.map do |h| Transaction.new @client, self, h['txid'] end end |