Class: AUB::Payroll::EPFFile::Header

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHeader

Returns a new instance of Header.

Parameters:

  • company_name: (String)
  • date: (Date)

Raises:



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

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

Instance Attribute Details

#company_nameObject

Returns the value of attribute company_name.



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

def company_name
  @company_name
end

#dateObject

Returns the value of attribute date.



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

def date
  @date
end

Instance Method Details

#to_sObject



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

def to_s
  [
    'BF', # marks the beginning of file
    formatted_company_name,
    formatted_date,
  ].join
end