Class: UOB::Payroll::TXTFile
- Inherits:
-
Object
- Object
- UOB::Payroll::TXTFile
- Extended by:
- ActiveSupport::Autoload
- Includes:
- ActiveModel::Model
- Defined in:
- lib/uob/payroll/txt_file.rb
Defined Under Namespace
Instance Method Summary collapse
- #content ⇒ Object
-
#initialize(company_name:, account_number:, branch_code:, date:, payable_date:, transactions:) ⇒ TXTFile
constructor
A new instance of TXTFile.
Constructor Details
#initialize(company_name:, account_number:, branch_code:, date:, payable_date:, transactions:) ⇒ TXTFile
Returns a new instance of TXTFile.
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/uob/payroll/txt_file.rb', line 14 def initialize(company_name:, account_number:, branch_code:, date:, payable_date:, transactions:) @header = Header.new( company_name: company_name, account_number: account_number, branch_code: branch_code, creation_date: date, value_date: payable_date ) @rows = transactions.map { |transaction| Row.new **transaction } @footer = Footer.new total_amount: total_amount(rows), header: header, rows: rows end |
Instance Method Details
#content ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/uob/payroll/txt_file.rb', line 26 def content [ header, rows, , ].join("\n") end |