module SingaporeCharitableDonations::Calculators::MBMF::Year2009Calculator
Mosque Building and Mendaki Fund contribution calculator for the year 2009 onwards.
Constants
- CUTOFF_DATE
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/mbmf/year_2009_calculator.rb, line 31 def applies_to?(date, type) date.year >= 2009 && date < CUTOFF_DATE && type == 'MBMF' end
calculate(total_wages)
click to toggle source
@param [BigDecimal] total_wages @return [BigDecimal] contribution amount
# File lib/singapore_charitable_donations/calculators/mbmf/year_2009_calculator.rb, line 11 def calculate(total_wages) case when total_wages <= 200.00 BigDecimal "0.00" when total_wages < 1_001.00 BigDecimal "2.00" when total_wages < 2_001.00 BigDecimal "3.50" when total_wages < 3_001.00 BigDecimal "5.00" when total_wages < 4_001.00 BigDecimal "12.50" else # total_wages >= 4_001.00 BigDecimal "16.00" end end