Class: BitWallet::Transaction
- Inherits:
-
Object
- Object
- BitWallet::Transaction
- Defined in:
- lib/bit_wallet/transaction.rb
Constant Summary collapse
- READER_ATTRS =
[:account, :amount, :category, :confirmations, :id, :occurred_at, :received_at, :address_str]
Instance Method Summary collapse
- #address ⇒ Object
-
#initialize(wallet, args) ⇒ Transaction
constructor
A new instance of Transaction.
Constructor Details
#initialize(wallet, args) ⇒ Transaction
Returns a new instance of Transaction.
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/bit_wallet/transaction.rb', line 15 def initialize(wallet, args) args = args.with_indifferent_access @wallet = wallet @account = wallet.accounts.new(args[:account]) @id = args[:txid] @address_str = args[:address] @amount = args[:amount] @confirmations = args[:confirmations] @occurred_at = Time.at(args[:time]) @received_at = Time.at(args[:timereceived]) @category = args[:category] end |
Instance Method Details
#address ⇒ Object
28 29 30 31 32 |
# File 'lib/bit_wallet/transaction.rb', line 28 def address @address ||= @account.addresses.find do |address| address.address == @address_str end end |