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