module TaxCalculator::Ohio

Public Class Methods

taxes_for(income) click to toggle source
# File lib/tax_calculator/ohio.rb, line 5
def self.taxes_for(income)
  from_brackets(income).round(2)
end

Private Class Methods

from_brackets(income) click to toggle source

2020

# File lib/tax_calculator/ohio.rb, line 12
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