Class: UOB::Payroll::TXTFile::Header
- Inherits:
-
Object
- Object
- UOB::Payroll::TXTFile::Header
- Includes:
- ActiveModel::Model, TxtData::TxtDataRowDSL
- Defined in:
- lib/uob/payroll/txt_file/header.rb
Instance Attribute Summary collapse
-
#account_number ⇒ Object
readonly
Returns the value of attribute account_number.
-
#branch_code ⇒ Object
readonly
Returns the value of attribute branch_code.
-
#company_name ⇒ Object
readonly
Returns the value of attribute company_name.
-
#creation_date ⇒ Object
readonly
Returns the value of attribute creation_date.
-
#value_date ⇒ Object
readonly
Returns the value of attribute value_date.
Instance Method Summary collapse
- #bulk_customer_reference ⇒ Object
- #filename ⇒ Object
- #formatted_creation_date ⇒ Object
- #formatted_value_date ⇒ Object
-
#initialize(company_name:, account_number:, branch_code:, creation_date:, value_date:) ⇒ Header
constructor
A new instance of Header.
- #originating_account_name ⇒ Object
- #originating_account_number ⇒ Object
- #originating_bic_code ⇒ Object
Methods included from TxtData::TxtDataRowDSL
Constructor Details
#initialize(company_name:, account_number:, branch_code:, creation_date:, value_date:) ⇒ Header
Returns a new instance of Header.
34 35 36 37 38 39 40 41 42 |
# File 'lib/uob/payroll/txt_file/header.rb', line 34 def initialize(company_name:, account_number:, branch_code:, creation_date:, value_date:) @company_name = company_name @account_number = account_number @branch_code = branch_code @creation_date = creation_date @value_date = value_date raise Errors::Invalid, errors..to_sentence unless valid? end |
Instance Attribute Details
#account_number ⇒ Object (readonly)
Returns the value of attribute account_number.
27 28 29 |
# File 'lib/uob/payroll/txt_file/header.rb', line 27 def account_number @account_number end |
#branch_code ⇒ Object (readonly)
Returns the value of attribute branch_code.
27 28 29 |
# File 'lib/uob/payroll/txt_file/header.rb', line 27 def branch_code @branch_code end |
#company_name ⇒ Object (readonly)
Returns the value of attribute company_name.
27 28 29 |
# File 'lib/uob/payroll/txt_file/header.rb', line 27 def company_name @company_name end |
#creation_date ⇒ Object (readonly)
Returns the value of attribute creation_date.
27 28 29 |
# File 'lib/uob/payroll/txt_file/header.rb', line 27 def creation_date @creation_date end |
#value_date ⇒ Object (readonly)
Returns the value of attribute value_date.
27 28 29 |
# File 'lib/uob/payroll/txt_file/header.rb', line 27 def value_date @value_date end |
Instance Method Details
#bulk_customer_reference ⇒ Object
68 69 70 |
# File 'lib/uob/payroll/txt_file/header.rb', line 68 def bulk_customer_reference "PAYROLL#{creation_date.strftime('%d%m')}" end |
#filename ⇒ Object
44 45 46 |
# File 'lib/uob/payroll/txt_file/header.rb', line 44 def filename "UGBI#{creation_date.strftime('%d%m')}01" end |
#formatted_creation_date ⇒ Object
60 61 62 |
# File 'lib/uob/payroll/txt_file/header.rb', line 60 def formatted_creation_date creation_date.strftime '%Y%m%d' end |
#formatted_value_date ⇒ Object
64 65 66 |
# File 'lib/uob/payroll/txt_file/header.rb', line 64 def formatted_value_date value_date.strftime '%Y%m%d' end |
#originating_account_name ⇒ Object
56 57 58 |
# File 'lib/uob/payroll/txt_file/header.rb', line 56 def originating_account_name String(company_name).upcase.ljust 140 end |
#originating_account_number ⇒ Object
52 53 54 |
# File 'lib/uob/payroll/txt_file/header.rb', line 52 def originating_account_number account_number end |
#originating_bic_code ⇒ Object
48 49 50 |
# File 'lib/uob/payroll/txt_file/header.rb', line 48 def originating_bic_code "UOVBSGSG#{branch_code}" end |