Class: AUB::Payroll::EPFFile
- Inherits:
-
Object
- Object
- AUB::Payroll::EPFFile
- Extended by:
- ActiveSupport::Autoload
- Includes:
- ActiveModel::Model
- Defined in:
- lib/aub/payroll/epf_file.rb
Defined Under Namespace
Instance Method Summary collapse
- #content ⇒ Object
-
#initialize(company_name:, date:, transactions:) ⇒ EPFFile
constructor
A new instance of EPFFile.
Constructor Details
#initialize(company_name:, date:, transactions:) ⇒ EPFFile
Returns a new instance of EPFFile.
14 15 16 17 18 |
# File 'lib/aub/payroll/epf_file.rb', line 14 def initialize(company_name:, date:, transactions:) @header = Header.new company_name: company_name, date: date @rows = transactions.map { |transaction| Row.new transaction } = .new number_of_records: rows.count, total_amount: rows.sum(&:amount) end |
Instance Method Details
#content ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/aub/payroll/epf_file.rb', line 20 def content [ header, rows, , ].join("\r\n") end |