module SingaporeCharitableDonations::Calculators::CDAC::Year2015Calculator

Chinese Development Assistance Council (CDAC) Fund contribution calculator for year 2015 onwards.

Public Class Methods

applies_to?(date, type) click to toggle source

@param [Date] date to be considered for calculation @param [String] type of charitable contribution @return [TrueClass, FalseClass]

# File lib/singapore_charitable_donations/calculators/cdac/year_2015_calculator.rb, line 29
def applies_to?(date, type)
  date.year >= 2015 && type == 'CDAC'
end
calculate(total_wage) click to toggle source

@param [BigDecimal] total_wage @return [BigDecimal] contribution amount

# File lib/singapore_charitable_donations/calculators/cdac/year_2015_calculator.rb, line 11
def calculate(total_wage)
  case
  when total_wage <= 2_000.00
    BigDecimal "0.50"
  when total_wage <= 3_500.00
    BigDecimal "1.00"
  when total_wage <= 5_000.00
    BigDecimal "1.50"
  when total_wage <= 7_500.00
    BigDecimal "2.00"
  when total_wage > 7_500.00
    BigDecimal "3.00"
  end
end