# frozen_string_literal: true require "tax_calculator/version" require "tax_calculator/federal" require "tax_calculator/fica" require "tax_calculator/deductions" require "tax_calculator/ohio" require "tax_calculator/ohio/columbus" module TaxCalculator class TaxCalculator def initialize(income, four_01_k, ira, hsa, health_premiums) @income = income.to_i @four_01_k = four_01_k.to_i @ira = ira.to_i @hsa = hsa.to_i @health_premiums = health_premiums.to_i end def calculate deductions = Deductions.new(@income, @four_01_k, @ira, @hsa, @health_premiums) federal = Federal.taxes_for(deductions.federal).round(2) fica = FICA.taxes_for(deductions.fica).round(2) state = Ohio.taxes_for(deductions.ohio).round(2) county = Ohio::Columbus.taxes_for(deductions.columbus).round(2) total = (federal + fica + state + county).round(2) { :federal => federal, :fica => fica, :state => state, :county => county, :total => total } end end end