eurovat 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/eurovat.rb +5 -5
- data/lib/eurovat/version.rb +1 -1
- metadata +3 -3
data/lib/eurovat.rb
CHANGED
@@ -68,6 +68,10 @@ class Eurovat
|
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
|
+
def self.sanitize_vat_number(vat_number)
|
72
|
+
vat_number.gsub(/[\s\t\.]/, '').upcase
|
73
|
+
end
|
74
|
+
|
71
75
|
def self.check_vat_number(vat_number)
|
72
76
|
@@instance ||= new
|
73
77
|
@@instance.check_vat_number(vat_number)
|
@@ -85,7 +89,7 @@ class Eurovat
|
|
85
89
|
|
86
90
|
# Any exception other than InvalidFormatError indicates that the service is down.
|
87
91
|
def check_vat_number(vat_number)
|
88
|
-
vat_number = sanitize_vat_number(vat_number)
|
92
|
+
vat_number = Eurovat.sanitize_vat_number(vat_number)
|
89
93
|
if vat_number =~ VAT_FORMAT
|
90
94
|
country_code = $1
|
91
95
|
number = $2
|
@@ -138,8 +142,4 @@ private
|
|
138
142
|
!!val
|
139
143
|
end
|
140
144
|
end
|
141
|
-
|
142
|
-
def sanitize_vat_number(vat_number)
|
143
|
-
vat_number.gsub(/[\s\t\.]/, '').upcase
|
144
|
-
end
|
145
145
|
end
|
data/lib/eurovat/version.rb
CHANGED
metadata
CHANGED