Module: DeathAndTaxes

Defined in:
lib/generators/death_and_taxes/migration/migration_generator.rb,
lib/death_and_taxes.rb,
lib/death_and_taxes/tax.rb,
lib/death_and_taxes/state.rb,
lib/death_and_taxes/taxer.rb,
lib/death_and_taxes/country.rb,
lib/death_and_taxes/taxable.rb,
lib/death_and_taxes/version.rb,
lib/death_and_taxes/tax_info.rb,
lib/death_and_taxes/taxation.rb,
lib/death_and_taxes/tax_version.rb

Overview

Blindly copied from acts-as-taggable-on

Defined Under Namespace

Modules: Taxable, Taxer Classes: Country, MigrationGenerator, State, Tax, TaxInfo, TaxVersion, Taxation

Constant Summary collapse

VERSION =
'0.0.5'

Class Method Summary collapse

Class Method Details

.applicable_taxes(from, to, date = nil) ⇒ Object



18
19
20
21
# File 'lib/death_and_taxes.rb', line 18

def self.applicable_taxes from, to, date = nil
  date ||= Date.today
  @countries.map{ |code, country| country.applicable_taxes(from, to, date)}.flatten.compact
end

.build(tax, date) ⇒ Object



23
24
25
# File 'lib/death_and_taxes.rb', line 23

def self.build tax, date
  @countries.detect {|code, country| country.build_tax(tax, date)}.try(:last).try(:build_tax, tax, date)
end