Sha256: 12af9c35a40dde0138095ff87b092a1c24eef2995cce1f5025df30b5d1090a5e

Contents?: true

Size: 1.03 KB

Versions: 4

Compression:

Stored size: 1.03 KB

Contents

module SingaporeCharitableDonations
  module Calculators
    module ECF

      # Eurasian Community Fund contribution calculator for the year 2014.
      class Year2014Calculator
        class << self

          # @param [BigDecimal] total_wage
          # @return [BigDecimal] contribution amount
          def calculate(total_wages)
            case
            when total_wages <= 1_000.00
              BigDecimal "2.00"
            when total_wages <= 1_500.00
              BigDecimal "4.00"
            when total_wages <= 2_500.00
              BigDecimal "6.00"
            when total_wages <= 4_000.00
              BigDecimal "8.00"
            else # total_wages > 4_000.00
              BigDecimal "10.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 == 'ECF'
          end

        end

      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
singapore_charitable_donations-1.0.3 lib/singapore_charitable_donations/calculators/ecf/year_2014_calculator.rb
singapore_charitable_donations-1.0.1 lib/singapore_charitable_donations/calculators/ecf/year_2014_calculator.rb
singapore_charitable_donations-1.0.0 lib/singapore_charitable_donations/calculators/ecf/year_2014_calculator.rb
singapore_charitable_donations-0.0.1 lib/singapore_charitable_donations/calculators/ecf/year_2014_calculator.rb