Module: IncomeTax::Factory

Extended by:
Factory
Included in:
Factory
Defined in:
lib/income_tax/factory.rb

Constant Summary collapse

MONEY =
-> o { o.respond_to? :to_money }

Instance Method Summary collapse

Instance Method Details

#generate(*args, **options) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/income_tax/factory.rb', line 8

def generate(*args, **options)
  parse_args(args,   options)
  set_income(:net,   options)
  set_income(:gross, options)

  location         = CountryRegister[options[:country]  || no_country]
  options[:income] = parse_income(options[:income], location)
  location.new(options)
end