Class: SingaporeCPFCalculator::AgeGroup
- Inherits:
-
Object
- Object
- SingaporeCPFCalculator::AgeGroup
- Defined in:
- lib/singapore_cpf_calculator/age_group.rb
Overview
The contribution rates in respect of an employee above 35, 50, 55, 60 or 65 years of age shall be applied from the first day of the month after the month of his 35th, 50th, 55th, 60th or 65th birthday.
Class Method Summary collapse
-
.get(current_date, birthdate:) ⇒ Symbol
The symbol representation of the age group - :group_50_years_and_below - :group_55_years_and_below - :group_above_50_to_55_years - :group_above_55_to_60_years - :group_above_60_to_65_years - :group_above_65_years.
Instance Method Summary collapse
-
#get ⇒ Symbol
The symbol representation of the age group - :group_50_years_and_below - :group_55_years_and_below - :group_above_50_to_55_years - :group_above_55_to_60_years - :group_above_60_to_65_years - :group_above_65_years.
-
#initialize(current_date, birthdate:) ⇒ AgeGroup
constructor
A new instance of AgeGroup.
Constructor Details
#initialize(current_date, birthdate:) ⇒ AgeGroup
Returns a new instance of AgeGroup.
26 27 28 29 |
# File 'lib/singapore_cpf_calculator/age_group.rb', line 26 def initialize(current_date, birthdate:) @current_date = current_date @birthdate = birthdate end |
Class Method Details
.get(current_date, birthdate:) ⇒ Symbol
Returns the symbol representation of the age group
-
:group_50_years_and_below
-
:group_55_years_and_below
-
:group_above_50_to_55_years
-
:group_above_55_to_60_years
-
:group_above_60_to_65_years
-
:group_above_65_years.
19 20 21 |
# File 'lib/singapore_cpf_calculator/age_group.rb', line 19 def get(current_date, birthdate:) new(current_date, birthdate: birthdate).get end |
Instance Method Details
#get ⇒ Symbol
Returns the symbol representation of the age group
-
:group_50_years_and_below
-
:group_55_years_and_below
-
:group_above_50_to_55_years
-
:group_above_55_to_60_years
-
:group_above_60_to_65_years
-
:group_above_65_years.
38 39 40 41 42 43 44 |
# File 'lib/singapore_cpf_calculator/age_group.rb', line 38 def get if current_date.year <= 2015 age_grouping_for_2015_and_earlier else age_grouping_for_2016_and_later end end |