Class: IncomeTax::Models::FixedRate

Inherits:
Generic
  • Object
show all
Defined in:
lib/income_tax/models/fixed_rate.rb

Instance Attribute Summary

Attributes inherited from Generic

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from 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

.rate(value = nil) ⇒ Object



4
5
6
7
# File 'lib/income_tax/models/fixed_rate.rb', line 4

def self.rate(value = nil)
  @rate   = Rate.new(value) if value
  @rate ||= superclass.rate
end

Instance Method Details

#calculateObject



9
10
11
# File 'lib/income_tax/models/fixed_rate.rb', line 9

def calculate
  @rate = self.class.rate
end