Class: DeathAndTaxes::Tax
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- DeathAndTaxes::Tax
- Defined in:
- lib/death_and_taxes/tax.rb
Instance Method Summary collapse
Instance Method Details
#apply(amount) ⇒ Object
9 10 11 |
# File 'lib/death_and_taxes/tax.rb', line 9 def apply amount amount * multiplier end |
#blank? ⇒ Boolean
17 18 19 |
# File 'lib/death_and_taxes/tax.rb', line 17 def blank? percentage.blank? && name.blank? && account_number.blank? end |
#multiplier ⇒ Object
13 14 15 |
# File 'lib/death_and_taxes/tax.rb', line 13 def multiplier (percentage / 100) * (1 + tax.try(:multiplier).to_f) end |