Class: IncomeTax::Countries::Tanzania
- Inherits:
-
Models::Progressive
- Object
- Models::Generic
- Models::Progressive
- IncomeTax::Countries::Tanzania
- Defined in:
- lib/income_tax/countries/tanzania.rb
Constant Summary collapse
- GROSS_PRESUMPTIVE =
20_000_000
- NET_PRESUMPTIVE =
GROSS_PRESUMPTIVE - levels(:presumptive).calculate_gross(GROSS_PRESUMPTIVE)
Instance Attribute Summary
Attributes inherited from Models::Generic
#gross_income, #net_income, #options, #rate, #taxes
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, #setup, #validate, wants_options
Constructor Details
This class inherits a constructor from IncomeTax::Models::Generic
Instance Method Details
#level_category ⇒ Object
48 49 50 |
# File 'lib/income_tax/countries/tanzania.rb', line 48 def level_category presumptive? ? :presumptive : location end |
#set_default_options ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/income_tax/countries/tanzania.rb', line 36 def [:presumptive] = true if [:presumptive].nil? [:presumptive] = false if gross_income and gross_income > GROSS_PRESUMPTIVE [:presumptive] = false if net_income and net_income > NET_PRESUMPTIVE case location = [:location].to_s.downcase when 'mainland', 'zanzibar' then [:location] = location.to_sym when '' then [:location] = :mainland else raise ArgumentError, 'location needs to be mainland or zanzibar' end end |