Class: Bitbank::Transaction
- Inherits:
-
Object
- Object
- Bitbank::Transaction
- Defined in:
- lib/bitbank/transaction.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#confirmations ⇒ Object
readonly
Returns the value of attribute confirmations.
-
#txid ⇒ Object
readonly
Returns the value of attribute txid.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #account ⇒ Object
- #confirmed? ⇒ Boolean
-
#initialize(client, txid, data = {}) ⇒ Transaction
constructor
A new instance of Transaction.
- #time ⇒ Object
Constructor Details
#initialize(client, txid, data = {}) ⇒ Transaction
Returns a new instance of Transaction.
5 6 7 8 9 10 |
# File 'lib/bitbank/transaction.rb', line 5 def initialize(client, txid, data={}) @client = client @txid = txid load_details(data) end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
3 4 5 |
# File 'lib/bitbank/transaction.rb', line 3 def address @address end |
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
3 4 5 |
# File 'lib/bitbank/transaction.rb', line 3 def amount @amount end |
#category ⇒ Object (readonly)
Returns the value of attribute category.
3 4 5 |
# File 'lib/bitbank/transaction.rb', line 3 def category @category end |
#confirmations ⇒ Object (readonly)
Returns the value of attribute confirmations.
3 4 5 |
# File 'lib/bitbank/transaction.rb', line 3 def confirmations @confirmations end |
#txid ⇒ Object (readonly)
Returns the value of attribute txid.
3 4 5 |
# File 'lib/bitbank/transaction.rb', line 3 def txid @txid end |
Instance Method Details
#==(other) ⇒ Object
24 25 26 |
# File 'lib/bitbank/transaction.rb', line 24 def ==(other) txid == other.txid end |
#account ⇒ Object
12 13 14 |
# File 'lib/bitbank/transaction.rb', line 12 def account @account ? Account.new(@client, @account) : nil end |
#confirmed? ⇒ Boolean
20 21 22 |
# File 'lib/bitbank/transaction.rb', line 20 def confirmed? confirmations && confirmations > 6 end |
#time ⇒ Object
16 17 18 |
# File 'lib/bitbank/transaction.rb', line 16 def time Time.at(@time) end |