Sha256: 598521e45c5ab6f6b2001a641c66ccc2415a534b0943e2ac0eadc86066f4b171
Contents?: true
Size: 701 Bytes
Versions: 3
Compression:
Stored size: 701 Bytes
Contents
require "active_model" module AUB module Payroll class EPFFile extend ActiveSupport::Autoload autoload :Header autoload :Row autoload :Footer include ActiveModel::Model def initialize(company_name:, date:, transactions:) @header = Header.new company_name: company_name, date: date @rows = transactions.map { |transaction| Row.new transaction } @footer = Footer.new number_of_records: rows.count, total_amount: rows.sum(&:amount) end def content [ header, rows, footer, ].join("\r\n") end private attr_accessor :header, :rows, :footer end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
aub-payroll-1.1.0 | lib/aub/payroll/epf_file.rb |
aub-payroll-1.0.1 | lib/aub/payroll/epf_file.rb |
aub-payroll-1.0.0 | lib/aub/payroll/epf_file.rb |