Class: BankPayments::SwedbankExport::File
- Inherits:
-
Object
- Object
- BankPayments::SwedbankExport::File
- Defined in:
- lib/bank_payments/swedbank_export/file.rb
Overview
Contains international payments to be made to foreign beneficiaries. The file contains one or more sequnces containing payments.
Instance Attribute Summary collapse
-
#file_name ⇒ Object
Returns the value of attribute file_name.
Instance Method Summary collapse
-
#<<(sequence) ⇒ Object
Adds a sequence to the file.
-
#initialize(file_name) ⇒ File
constructor
A new instance of File.
- #to_file_data ⇒ Object
Constructor Details
#initialize(file_name) ⇒ File
Returns a new instance of File.
10 11 12 13 |
# File 'lib/bank_payments/swedbank_export/file.rb', line 10 def initialize(file_name) @file_name = file_name @sequences = [] end |
Instance Attribute Details
#file_name ⇒ Object
Returns the value of attribute file_name.
8 9 10 |
# File 'lib/bank_payments/swedbank_export/file.rb', line 8 def file_name @file_name end |
Instance Method Details
#<<(sequence) ⇒ Object
Adds a sequence to the file
16 17 18 |
# File 'lib/bank_payments/swedbank_export/file.rb', line 16 def <<(sequence) @sequences << sequence end |
#to_file_data ⇒ Object
20 21 22 23 24 |
# File 'lib/bank_payments/swedbank_export/file.rb', line 20 def to_file_data sequence_data = @sequences.map { |sequence| sequence.to_file_data } sequence_data.join("\n").encode('iso-8859-1') end |