Permalink
Browse files

Merge pull request #1 from elliottkember/master

Much faster in Ruby 1.9
  • Loading branch information...
2 parents 8802977 + 5549d9c commit 08168763668d1289090e356e486fa9143aea0ed5 @adamcooke committed Oct 6, 2011
Showing with 3 additions and 4 deletions.
  1. +3 −4 lib/uk_vat_rate.rb
View
@@ -1,12 +1,11 @@
class UkVatRate
def self.on(date)
- case date
- when Date.new(0, 1, 1)..Date.new(2008, 12, 31)
+ if Date.new(1973, 1, 1) < date && date < Date.new(2008, 12, 31)
17.5
- when Date.new(2009, 01, 01)..Date.new(2009, 12, 31)
+ elsif Date.new(2009, 01, 01) < date && date < Date.new(2009, 12, 31)
15
- when Date.new(2010, 01, 01)..Date.new(2011, 01, 03)
+ elsif Date.new(2010, 01, 01) < date && date < Date.new(2011, 01, 03)
17.5
else
20

0 comments on commit 0816876

Please sign in to comment.