Sha256: 5581626b4615652050c24ac242f3bc60c767c18d539f880e48eaa1b9c9f86127

Contents?: true

Size: 995 Bytes

Versions: 44

Compression:

Stored size: 995 Bytes

Contents

module Caboose
  class TaxCalculator
    def self.tax_rate(address)      
      return 0.00 if address.nil? || address.city.nil? || address.state.nil?       
      return 0 if address.state.downcase != 'al'      
      rate = 0.00      
      city = address.city.downcase            
      rate = rate + 0.05 if city == 'brookwood'  
      rate = rate + 0.05 if city == 'coaling'    
      rate = rate + 0.05 if city == 'coker'      
      rate = rate + 0.05 if city == 'holt'       
      rate = rate + 0.05 if city == 'holt CDP'   
      rate = rate + 0.05 if city == 'lake View'  
      rate = rate + 0.05 if city == 'moundville' 
      rate = rate + 0.05 if city == 'northport'  
      rate = rate + 0.05 if city == 'tuscaloosa' 
      rate = rate + 0.05 if city == 'vance'      
      rate = rate + 0.05 if city == 'woodstock'      
      rate = rate + 0.04 if address.state.downcase == 'al' || address.state.downcase == 'alabama'              
      return rate.round(2)
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
caboose-cms-0.5.109 app/models/caboose/tax_calculator.rb
caboose-cms-0.5.108 app/models/caboose/tax_calculator.rb
caboose-cms-0.5.107 app/models/caboose/tax_calculator.rb
caboose-cms-0.5.106 app/models/caboose/tax_calculator.rb
caboose-cms-0.5.105 app/models/caboose/tax_calculator.rb
caboose-cms-0.5.104 app/models/caboose/tax_calculator.rb
caboose-cms-0.5.103 app/models/caboose/tax_calculator.rb
caboose-cms-0.5.102 app/models/caboose/tax_calculator.rb
caboose-cms-0.5.101 app/models/caboose/tax_calculator.rb
caboose-cms-0.5.100 app/models/caboose/tax_calculator.rb
caboose-cms-0.5.99 app/models/caboose/tax_calculator.rb
caboose-cms-0.5.98 app/models/caboose/tax_calculator.rb
caboose-cms-0.5.97 app/models/caboose/tax_calculator.rb
caboose-cms-0.5.96 app/models/caboose/tax_calculator.rb
caboose-cms-0.5.95 app/models/caboose/tax_calculator.rb
caboose-cms-0.5.94 app/models/caboose/tax_calculator.rb
caboose-cms-0.5.93 app/models/caboose/tax_calculator.rb
caboose-cms-0.5.92 app/models/caboose/tax_calculator.rb
caboose-cms-0.5.91 app/models/caboose/tax_calculator.rb
caboose-cms-0.5.90 app/models/caboose/tax_calculator.rb