Class: DeathAndTaxes::Tax

Inherits:
ActiveRecord::Base
  • Object
show all
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

Returns:

  • (Boolean)


17
18
19
# File 'lib/death_and_taxes/tax.rb', line 17

def blank?
  percentage.blank? && name.blank? && .blank?
end

#multiplierObject



13
14
15
# File 'lib/death_and_taxes/tax.rb', line 13

def multiplier
  (percentage / 100) * (1 + tax.try(:multiplier).to_f)
end