# frozen_string_literal: true module TaxCalculator module Ohio def self.taxes_for(income) from_brackets(income).round(2) end private # 2020 def self.from_brackets(income) if income <= 22_150 0 elsif income <= 44_250 (income - 21_750) * 0.0285 + 310.47 elsif income <= 88_450 (income - 43_450) * 0.03326 + 928.92 elsif income <= 110_650 (income - 86_900) * 0.03802 + 2374.07 elsif income <= 221_300 (income - 108_700) * 0.04491 + 3202.91 elsif income > 221_300 (income - 217_400) * 0.04797 + 7999.84 end end end end