Class: LSVplus::TotalRecordFormatter
- Inherits:
-
Object
- Object
- LSVplus::TotalRecordFormatter
- Defined in:
- lib/lsv_plus/total_record_formatter.rb
Constant Summary collapse
- TYPE =
'890'
- VERSION =
'0'
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
- #creation_date ⇒ Object
- #creator_identification ⇒ Object
- #currency ⇒ Object
-
#initialize(file) ⇒ TotalRecordFormatter
constructor
A new instance of TotalRecordFormatter.
- #record_number ⇒ Object
- #total_amount ⇒ Object
Constructor Details
#initialize(file) ⇒ TotalRecordFormatter
Returns a new instance of TotalRecordFormatter.
14 15 16 |
# File 'lib/lsv_plus/total_record_formatter.rb', line 14 def initialize(file) @file = file end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
8 9 10 |
# File 'lib/lsv_plus/total_record_formatter.rb', line 8 def file @file end |
Class Method Details
.call(file) ⇒ Object
10 11 12 |
# File 'lib/lsv_plus/total_record_formatter.rb', line 10 def self.call(file) new(file).call end |
Instance Method Details
#call ⇒ Object
18 19 20 |
# File 'lib/lsv_plus/total_record_formatter.rb', line 18 def call [TYPE, VERSION, creation_date, creator_identification, record_number, currency, total_amount].join('') end |
#creation_date ⇒ Object
22 23 24 |
# File 'lib/lsv_plus/total_record_formatter.rb', line 22 def creation_date LSVplus::FormattingHelper.date file.creation_date end |
#creator_identification ⇒ Object
26 27 28 |
# File 'lib/lsv_plus/total_record_formatter.rb', line 26 def creator_identification file.creator_identification end |
#currency ⇒ Object
34 35 36 |
# File 'lib/lsv_plus/total_record_formatter.rb', line 34 def currency file.currency end |
#record_number ⇒ Object
30 31 32 |
# File 'lib/lsv_plus/total_record_formatter.rb', line 30 def record_number LSVplus::FormattingHelper.index file.records.length end |
#total_amount ⇒ Object
38 39 40 |
# File 'lib/lsv_plus/total_record_formatter.rb', line 38 def total_amount LSVplus::FormattingHelper.amount file.total end |