Sha256: 1bd22f0a7d7410b3fec019ee86a1216e8bf1d3b9808bee51846b025bb4c8c26b
Contents?: true
Size: 980 Bytes
Versions: 3
Compression:
Stored size: 980 Bytes
Contents
require 'active_model' module AUB module Payroll class EPFFile::Footer include ActiveModel::Model attr_accessor :number_of_records, :total_amount validates :number_of_records, numericality: { greater_than: 0, less_than_or_equal_to: 999_999 } validates :total_amount, numericality: { greater_than: 0, less_than_or_equal_to: 999_999_999_999.99 } # @param [Integer] number_of_records: # @param [BigDecimal] total_amount: def initialize(*) super raise Errors::Invalid, errors.full_messages.to_sentence unless valid? end def to_s [ 'EF', # marks the end of file formatted_number_of_records, formatted_total_amount, '0' * 27, ].join end private def formatted_number_of_records format '%06d', number_of_records end def formatted_total_amount format '%015.2f', total_amount end 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/footer.rb |
aub-payroll-1.0.1 | lib/aub/payroll/epf_file/footer.rb |
aub-payroll-1.0.0 | lib/aub/payroll/epf_file/footer.rb |