Sha256: e14a806732e9b089e3803358c7df7ae4548a2140d1615136bf5c89ed19b1950d

Contents?: true

Size: 958 Bytes

Versions: 6

Compression:

Stored size: 958 Bytes

Contents

module SingaporeCPFCalculator
  # Contains the calculators that are used for determining CPF contribution for 2014.
  module SPR2FGCommon

    # @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
    # @param [String] employee_contribution_type: ["full", "graduated"]
    # @param [String] employer_contribution_type: ["full", "graduated"]
    # @return [true, false]
    def applies_to?(
      status:,
      current_date:,
      spr_start_date:,
      employee_contribution_type:,
      employer_contribution_type:
    )
      status == "permanent_resident" &&
        SPRStatus.get(current_date, status_start_date: spr_start_date) == :SPR2 &&
        employee_contribution_type == "graduated" &&
        employer_contribution_type == "full"
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
singapore_cpf_calculator-1.5.1 lib/singapore_cpf_calculator/spr_2_fg_common.rb
singapore_cpf_calculator-1.5.0 lib/singapore_cpf_calculator/spr_2_fg_common.rb
singapore_cpf_calculator-1.4.0 lib/singapore_cpf_calculator/spr_2_fg_common.rb
singapore_cpf_calculator-1.3.4 lib/singapore_cpf_calculator/spr_2_fg_common.rb
singapore_cpf_calculator-1.2.0 lib/singapore_cpf_calculator/spr_2_fg_common.rb
singapore_cpf_calculator-1.1.1 lib/singapore_cpf_calculator/spr_2_fg_common.rb