Module: SingaporeCPFCalculator::BeforeSPR
- Defined in:
- lib/singapore_cpf_calculator/before_spr.rb
Overview
Residency module for Singaporean Permanent Residents before theirs status effectivity.
Class Method Summary collapse
- .applies_to?(status:, current_date:, spr_start_date:) ⇒ true, false
-
.calculator_for(current_date, birthdate:) ⇒ #calculator
Returns the CPF calculator that matches the age.
Class Method Details
.applies_to?(status:, current_date:, spr_start_date:) ⇒ true, false
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/singapore_cpf_calculator/before_spr.rb', line 14 def applies_to?( status:, current_date:, spr_start_date:, ** ) status == "permanent_resident" && ( spr_start_date.year > current_date.year || (spr_start_date.year == current_date.year && spr_start_date.month > current_date.month) ) end |
.calculator_for(current_date, birthdate:) ⇒ #calculator
Returns the CPF calculator that matches the age.
29 30 31 |
# File 'lib/singapore_cpf_calculator/before_spr.rb', line 29 def calculator_for(current_date, birthdate:) NullContributionCalculator end |