Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1 from elliottkember/master

Much faster in Ruby 1.9
  • Loading branch information...
commit 08168763668d1289090e356e486fa9143aea0ed5 2 parents 8802977 + 5549d9c
@adamcooke authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 lib/uk_vat_rate.rb
View
7 lib/uk_vat_rate.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.