Class: LSVplus::RecordFormatter
- Inherits:
-
Object
- Object
- LSVplus::RecordFormatter
- Defined in:
- lib/lsv_plus/record_formatter.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#record ⇒ Object
readonly
Returns the value of attribute record.
Class Method Summary collapse
Instance Method Summary collapse
- #amount ⇒ Object
- #call ⇒ Object
- #creation_date ⇒ Object
- #creator_identification ⇒ Object
- #creditor_address ⇒ Object
- #creditor_bank_clearing_number ⇒ Object
- #creditor_iban ⇒ Object
- #currency ⇒ Object
- #debitor_account ⇒ Object
- #debitor_address ⇒ Object
- #debitor_bank_clearing_number ⇒ Object
- #esr_member_id ⇒ Object
-
#initialize(file, record, index) ⇒ RecordFormatter
constructor
A new instance of RecordFormatter.
- #lsv_identification ⇒ Object
- #message ⇒ Object
- #processing_date ⇒ Object
- #processing_type ⇒ Object
- #record_number ⇒ Object
- #reference ⇒ Object
- #reference_type ⇒ Object
- #type ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(file, record, index) ⇒ RecordFormatter
Returns a new instance of RecordFormatter.
11 12 13 14 15 16 |
# File 'lib/lsv_plus/record_formatter.rb', line 11 def initialize(file, record, index) @file = file @record = record @index = index @output = StringIO.new end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
5 6 7 |
# File 'lib/lsv_plus/record_formatter.rb', line 5 def file @file end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
5 6 7 |
# File 'lib/lsv_plus/record_formatter.rb', line 5 def output @output end |
#record ⇒ Object (readonly)
Returns the value of attribute record.
5 6 7 |
# File 'lib/lsv_plus/record_formatter.rb', line 5 def record @record end |
Class Method Details
.call(file, record, index) ⇒ Object
7 8 9 |
# File 'lib/lsv_plus/record_formatter.rb', line 7 def self.call(file, record, index) new(file, record, index).call end |
Instance Method Details
#amount ⇒ Object
74 75 76 |
# File 'lib/lsv_plus/record_formatter.rb', line 74 def amount LSVplus::FormattingHelper.amount record.amount end |
#call ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/lsv_plus/record_formatter.rb', line 18 def call [ type, version, processing_type, processing_date, debitor_bank_clearing_number, creation_date, creditor_bank_clearing_number, creator_identification, record_number, lsv_identification, currency, amount, creditor_iban, creditor_address, debitor_account, debitor_address, , reference_type, reference, esr_member_id ].join('') end |
#creation_date ⇒ Object
50 51 52 |
# File 'lib/lsv_plus/record_formatter.rb', line 50 def creation_date LSVplus::FormattingHelper.date file.creation_date end |
#creator_identification ⇒ Object
58 59 60 |
# File 'lib/lsv_plus/record_formatter.rb', line 58 def creator_identification file.creator_identification end |
#creditor_address ⇒ Object
82 83 84 |
# File 'lib/lsv_plus/record_formatter.rb', line 82 def creditor_address LSVplus::FormattingHelper.multiline record.creditor_address end |
#creditor_bank_clearing_number ⇒ Object
46 47 48 |
# File 'lib/lsv_plus/record_formatter.rb', line 46 def creditor_bank_clearing_number LSVplus::FormattingHelper.clearing_number record.creditor_bank_clearing_number end |
#creditor_iban ⇒ Object
78 79 80 |
# File 'lib/lsv_plus/record_formatter.rb', line 78 def creditor_iban LSVplus::FormattingHelper.account record.creditor_iban end |
#currency ⇒ Object
70 71 72 |
# File 'lib/lsv_plus/record_formatter.rb', line 70 def currency file.currency end |
#debitor_account ⇒ Object
86 87 88 |
# File 'lib/lsv_plus/record_formatter.rb', line 86 def debitor_account LSVplus::FormattingHelper.account record.debitor_account end |
#debitor_address ⇒ Object
90 91 92 |
# File 'lib/lsv_plus/record_formatter.rb', line 90 def debitor_address LSVplus::FormattingHelper.multiline record.debitor_address end |
#debitor_bank_clearing_number ⇒ Object
54 55 56 |
# File 'lib/lsv_plus/record_formatter.rb', line 54 def debitor_bank_clearing_number LSVplus::FormattingHelper.clearing_number record.debitor_bank_clearing_number end |
#esr_member_id ⇒ Object
106 107 108 |
# File 'lib/lsv_plus/record_formatter.rb', line 106 def esr_member_id format '%-9s', record.esr_member_id end |
#lsv_identification ⇒ Object
66 67 68 |
# File 'lib/lsv_plus/record_formatter.rb', line 66 def lsv_identification file.lsv_identification end |
#message ⇒ Object
94 95 96 |
# File 'lib/lsv_plus/record_formatter.rb', line 94 def LSVplus::FormattingHelper.multiline record. end |
#processing_date ⇒ Object
42 43 44 |
# File 'lib/lsv_plus/record_formatter.rb', line 42 def processing_date LSVplus::FormattingHelper.date record.processing_date end |
#processing_type ⇒ Object
38 39 40 |
# File 'lib/lsv_plus/record_formatter.rb', line 38 def processing_type file.processing_type end |
#record_number ⇒ Object
62 63 64 |
# File 'lib/lsv_plus/record_formatter.rb', line 62 def record_number LSVplus::FormattingHelper.index @index end |
#reference ⇒ Object
102 103 104 |
# File 'lib/lsv_plus/record_formatter.rb', line 102 def reference format '%-27s', record.reference end |
#reference_type ⇒ Object
98 99 100 |
# File 'lib/lsv_plus/record_formatter.rb', line 98 def reference_type record.reference_type end |
#type ⇒ Object
30 31 32 |
# File 'lib/lsv_plus/record_formatter.rb', line 30 def type record.type end |
#version ⇒ Object
34 35 36 |
# File 'lib/lsv_plus/record_formatter.rb', line 34 def version record.version end |