Sha256: cfcb0637565245dc811e49e12a2ab643db2243f92ffc24fdda45db97ae363a5f

Contents?: true

Size: 1.05 KB

Versions: 6

Compression:

Stored size: 1.05 KB

Contents

module SingaporeCPFCalculator

  module YearCommon

    # @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 [#residency_module]
    def module_for_residency(
      status:,
      current_date:,
      spr_start_date:,
      employee_contribution_type:,
      employer_contribution_type:
    )
      residency_modules.find { |mod|
        mod.applies_to? status: status,
                        current_date: current_date,
                        spr_start_date: spr_start_date,
                        employee_contribution_type: employee_contribution_type,
                        employer_contribution_type: employer_contribution_type
      } or raise ArgumentError, "could not find residency module"
    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/year_common.rb
singapore_cpf_calculator-1.5.0 lib/singapore_cpf_calculator/year_common.rb
singapore_cpf_calculator-1.4.0 lib/singapore_cpf_calculator/year_common.rb
singapore_cpf_calculator-1.3.4 lib/singapore_cpf_calculator/year_common.rb
singapore_cpf_calculator-1.2.0 lib/singapore_cpf_calculator/year_common.rb
singapore_cpf_calculator-1.1.1 lib/singapore_cpf_calculator/year_common.rb