# frozen_string_literal: true module TaxCalculator class Deductions STANDARD_DEDUCTION = 25_900 attr_reader :federal, :fica, :ohio, :columbus def initialize(income, four_01_k, ira, hsa, health_premiums) @federal = for_federal(income, four_01_k, ira, hsa, health_premiums) @fica = for_fica(income, hsa, health_premiums) @ohio = for_ohio(income, four_01_k, ira, hsa, health_premiums) @columbus = for_columbus(income, hsa, health_premiums) end def for_federal(income, four_01_k, ira, hsa, health_premiums) (income - (four_01_k + ira + hsa + health_premiums + STANDARD_DEDUCTION)) end def for_fica(income, hsa, health_premiums) (income - (hsa + health_premiums)) end def for_ohio(income, four_01_k, ira, hsa, health_premiums) num_exemptions = 2 personal_exemption = 1_900 * num_exemptions (income - (four_01_k + ira + hsa + health_premiums + personal_exemption)) end def for_columbus(income, hsa, health_premiums) income - (hsa + health_premiums) end end end