Class: AqBanking::Parsed::Transaction
- Inherits:
-
Object
- Object
- AqBanking::Parsed::Transaction
- Extended by:
- DefineField
- Defined in:
- lib/aq_banking/parsed/transaction.rb
Instance Attribute Summary collapse
-
#tree ⇒ Object
readonly
Returns the value of attribute tree.
Instance Method Summary collapse
-
#initialize(transaction_block) ⇒ Transaction
constructor
A new instance of Transaction.
- #to_h ⇒ Object
- #uid ⇒ Object
Methods included from DefineField
Constructor Details
#initialize(transaction_block) ⇒ Transaction
Returns a new instance of Transaction.
16 17 18 |
# File 'lib/aq_banking/parsed/transaction.rb', line 16 def initialize(transaction_block) @tree = transaction_block end |
Instance Attribute Details
#tree ⇒ Object (readonly)
Returns the value of attribute tree.
7 8 9 |
# File 'lib/aq_banking/parsed/transaction.rb', line 7 def tree @tree end |
Instance Method Details
#to_h ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/aq_banking/parsed/transaction.rb', line 24 def to_h %i(uid purpose local_bank_code local_account_number local_name remote_bank_code remote_account_number remote_name currency amount date valuta_date).reduce({}) do |result, field| result[field] = send(field) result end end |
#uid ⇒ Object
20 21 22 |
# File 'lib/aq_banking/parsed/transaction.rb', line 20 def uid Digest::SHA256.hexdigest self.tree.text_value end |