Method: IncomeTax::Countries::UnitedStates#setup

Defined in:
lib/income_tax/countries/united_states.rb

#setup(**options) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/income_tax/countries/united_states.rb', line 9

def setup(**options)
  @federal = Federal.new(**options)

  if state?
    factory = StateRegister[state]

    if factory.deduct_federal?
      options[:income]      = @federal.net_income
      options[:income_type] = :gross
    end

    @state = factory.new(**options)
  end
end