Class: Caboose::TaxCalculator

Inherits:
Object
  • Object
show all
Defined in:
app/models/caboose/tax_calculator.rb

Class Method Summary collapse

Class Method Details

.tax_rate(address) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/models/caboose/tax_calculator.rb', line 3

def self.tax_rate(address)      
  return 0.00 if address.nil? || address.city.nil? || address.state.nil?       
  return 0 if address.state.downcase != 'al'
  return 0.09      
  #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