Class: AUB::Payroll::EPFFile::Footer

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
lib/aub/payroll/epf_file/footer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFooter

Returns a new instance of Footer.

Parameters:

  • number_of_records: (Integer)
  • total_amount: (BigDecimal)

Raises:



15
16
17
18
# File 'lib/aub/payroll/epf_file/footer.rb', line 15

def initialize(*)
  super
  raise Errors::Invalid, errors.full_messages.to_sentence unless valid?
end

Instance Attribute Details

#number_of_recordsObject

Returns the value of attribute number_of_records.



8
9
10
# File 'lib/aub/payroll/epf_file/footer.rb', line 8

def number_of_records
  @number_of_records
end

#total_amountObject

Returns the value of attribute total_amount.



8
9
10
# File 'lib/aub/payroll/epf_file/footer.rb', line 8

def total_amount
  @total_amount
end

Instance Method Details

#to_sObject



20
21
22
23
24
25
26
27
# File 'lib/aub/payroll/epf_file/footer.rb', line 20

def to_s
  [
    'EF', # marks the end of file
    formatted_number_of_records,
    formatted_total_amount,
    '0' * 27,
  ].join
end