Class: IncomeTax::Countries::Canada
- Inherits:
-
Models::Generic
- Object
- Models::Generic
- IncomeTax::Countries::Canada
- Defined in:
- lib/income_tax/countries/canada.rb,
lib/income_tax/countries/canada/yukon.rb,
lib/income_tax/countries/canada/quebec.rb,
lib/income_tax/countries/canada/alberta.rb,
lib/income_tax/countries/canada/federal.rb,
lib/income_tax/countries/canada/nunavut.rb,
lib/income_tax/countries/canada/ontario.rb,
lib/income_tax/countries/canada/manitoba.rb,
lib/income_tax/countries/canada/nova_scotia.rb,
lib/income_tax/countries/canada/saskatchewan.rb,
lib/income_tax/countries/canada/new_brunswick.rb,
lib/income_tax/countries/canada/british_columbia.rb,
lib/income_tax/countries/canada/prince_edward_island.rb,
lib/income_tax/countries/canada/northwest_territories.rb,
lib/income_tax/countries/canada/newfoundland_and_labrador.rb
Defined Under Namespace
Classes: Alberta, BritishColumbia, Federal, Manitoba, NewBrunswick, NewfoundlandAndLabrador, NorthwestTerritories, NovaScotia, Nunavut, Ontario, PrinceEdwardIsland, Quebec, Saskatchewan, Yukon
Constant Summary collapse
- TerritoryRegister =
Register.new("territory")
- Territory =
Class.new(Models::Progressive) { register_on TerritoryRegister }
Instance Attribute Summary
Attributes inherited from Models::Generic
#gross_income, #net_income, #options, #rate, #taxes
Instance Method Summary collapse
Methods inherited from Models::Generic
#based_on?, #cast_value, #cast_values, currency, #initialize, #inspect, lazy, #location_name, method_added, name, names, new, other_names, register, register_on, #set_default_options, #validate, wants_options
Constructor Details
This class inherits a constructor from IncomeTax::Models::Generic
Instance Method Details
#calculate ⇒ Object
23 24 25 |
# File 'lib/income_tax/countries/canada.rb', line 23 def calculate @taxes = federal_taxes + territorial_taxes end |
#federal_taxes ⇒ Object
19 20 21 |
# File 'lib/income_tax/countries/canada.rb', line 19 def federal_taxes @federal.taxes end |
#setup(**options) ⇒ Object
9 10 11 12 |
# File 'lib/income_tax/countries/canada.rb', line 9 def setup(**) @federal = Federal.new(**) @territory = TerritoryRegister[territory].new(**) if territory? end |
#territorial_taxes ⇒ Object
14 15 16 17 |
# File 'lib/income_tax/countries/canada.rb', line 14 def territorial_taxes return 0 unless territory? @territory.taxes end |