Class: Document::All
- Inherits:
-
Treetop::Runtime::SyntaxNode
- Object
- Treetop::Runtime::SyntaxNode
- Document::All
- Defined in:
- lib/mt940parser/node_extensions.rb,
lib/mt940parser/node_extensions.rb
Instance Method Summary collapse
-
#a ⇒ Object
Utility.
- #to_hash ⇒ Object
- #transactions ⇒ Object
- #transactions_credit ⇒ Object
- #transactions_debit ⇒ Object
Instance Method Details
#a ⇒ Object
Utility
28 29 30 |
# File 'lib/mt940parser/node_extensions.rb', line 28 def a all_transactions.sample end |
#to_hash ⇒ Object
11 12 13 |
# File 'lib/mt940parser/node_extensions.rb', line 11 def to_hash elements.map(&:to_hash) end |
#transactions ⇒ Object
15 16 17 |
# File 'lib/mt940parser/node_extensions.rb', line 15 def transactions elements.flat_map(&:to_hash) end |
#transactions_credit ⇒ Object
19 20 21 |
# File 'lib/mt940parser/node_extensions.rb', line 19 def transactions_credit transactions.select{ |t| t[:type] == :credit} end |
#transactions_debit ⇒ Object
23 24 25 |
# File 'lib/mt940parser/node_extensions.rb', line 23 def transactions_debit transactions.select{ |t| t[:type] == :debit } end |