Class: BankPayments::SwedbankImport::File
- Inherits:
-
Object
- Object
- BankPayments::SwedbankImport::File
- Defined in:
- lib/bank_payments/swedbank_import/file.rb
Overview
Contains payments that have been made at the bank for a particular date. This maps to multiple export files created ealier. It will contain up to all payments requested earlier. When payouts fail the informaiton must be generated elsewhere.
Instance Attribute Summary collapse
-
#sequences ⇒ Object
Returns the value of attribute sequences.
Instance Method Summary collapse
-
#initialize(data) ⇒ File
constructor
Given the a string of file data the sequeces and records are created.
Constructor Details
#initialize(data) ⇒ File
Given the a string of file data the sequeces and records are created
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/bank_payments/swedbank_import/file.rb', line 14 def initialize(data) @sequences = [] current_sequence = nil data.gsub(/(\r|\n)+/,"\n").each_line do |raw_record| if opening_post?(raw_record) current_sequence = Sequence.new current_sequence << raw_record @sequences << current_sequence else current_sequence << raw_record end end end |
Instance Attribute Details
#sequences ⇒ Object
Returns the value of attribute sequences.
10 11 12 |
# File 'lib/bank_payments/swedbank_import/file.rb', line 10 def sequences @sequences end |