Sha256: 0f546d714890d47142f4effbe634240b4066b2089f504b413eebda6d6d796a3e
Contents?: true
Size: 858 Bytes
Versions: 4
Compression:
Stored size: 858 Bytes
Contents
module SingaporeCharitableDonations module Calculators module CDAC # Chinese Development Assistance Council (CDAC) Fund contribution calculator for year 2014. module Year2014Calculator class << self # @param [BigDecimal] total_wage # @return [BigDecimal] contribution amount def calculate(total_wage) case when total_wage < 2_000.00 BigDecimal "0.50" when total_wage >= 2_000.00 BigDecimal "1.00" end end # @param [Date] date to be considered for calculation # @param [String] type of charitable contribution # @return [TrueClass, FalseClass] def applies_to?(date, type) date.year == 2014 && type == 'CDAC' end end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems