Module: SingaporeCPFCalculator::ResidencyModuleCommon

Instance Method Summary collapse

Instance Method Details

#calculator_for(date, birthdate:) ⇒ #calculator

Returns the CPF calculator that matches the age.

Parameters:

  • date (Date)

    current date to which the age is calculated

  • birthdate (Date)

Returns:

  • (#calculator)

    returns the CPF calculator that matches the age.



7
8
9
# File 'lib/singapore_cpf_calculator/residency_module_common.rb', line 7

def calculator_for(date, birthdate:)
  calculators.find { |calculator| calculator.applies_to? date, birthdate: birthdate }
end