Class: IncomeTax::Countries::Switzerland::Canton

Inherits:
Models::Progressive show all
Defined in:
lib/income_tax/countries/switzerland/canton.rb

Instance Attribute Summary

Attributes inherited from Models::Generic

#gross_income, #net_income, #options, #rate, #taxes

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Models::Progressive

#calculate_gross, #calculate_net, level, levels, #levels, offset, remainder, tax_year, tax_years

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, #setup, #validate, wants_options

Constructor Details

This class inherits a constructor from IncomeTax::Models::Generic

Class Method Details

.cantonal_multiplier(value = nil) ⇒ Object



8
9
10
11
# File 'lib/income_tax/countries/switzerland/canton.rb', line 8

def self.cantonal_multiplier(value = nil)
  @cantonal_multiplier = Rate(value) if value
  @cantonal_multiplier ||= Rate("100%")
end

.municipal_multiplier(value = nil) ⇒ Object



13
14
15
16
# File 'lib/income_tax/countries/switzerland/canton.rb', line 13

def self.municipal_multiplier(value = nil)
  @municipal_multiplier = Rate(value) if value
  @municipal_multiplier ||= Rate("100%")
end

Instance Method Details

#cantonal_multiplierObject



24
25
26
# File 'lib/income_tax/countries/switzerland/canton.rb', line 24

def cantonal_multiplier
  self.class.cantonal_multiplier
end

#level_categoryObject



18
19
20
21
22
# File 'lib/income_tax/countries/switzerland/canton.rb', line 18

def level_category
  prefix = married? ? :B : :A
  count  = children > 9 ? 9 : 0
  :"#{prefix}#{count}"
end

#municipal_multiplierObject



28
29
30
# File 'lib/income_tax/countries/switzerland/canton.rb', line 28

def municipal_multiplier
  self.class.municipal_multiplier
end