module SingaporeCPFCalculator::BeforeSPR
Residency module for Singaporean Permanent Residents before theirs status effectivity.
Public Class Methods
applies_to?( status:, current_date:, spr_start_date:, ** )
click to toggle source
@param [String] status: [“citizen”, “permanent_resident”, “foreigner”] @param [Date] current_date: current date used to determine permanent residency’s duration @param [Date] spr_start_date: date when the permanent residency started @return [true, false]
# 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:)
click to toggle source
@param [Object] current_date @param [Object] birthdate @return [#calculator] returns the CPF calculator that matches the age.
# File lib/singapore_cpf_calculator/before_spr.rb, line 29 def calculator_for(current_date, birthdate:) NullContributionCalculator end