lib/europe/vat/format.rb in europe-0.0.12 vs lib/europe/vat/format.rb in europe-0.0.13
- old
+ new
@@ -36,10 +36,11 @@
}.freeze
def self.validate(number)
country_code = number[0..1].to_sym
number = sanitize_number(number, country_code)
- return false unless VAT_REGEX.keys.include?(country_code)
+ return false unless VAT_REGEX.key?(country_code)
+
match_vat_number(number, country_code)
end
def self.sanitize_number(number, country_code)
if %i[GB DK FR].include?(country_code)