Sha256: 81449dbd39a068ecda16f999dc5c691e39899359860f6ce30a8f0ab4904e01f1

Contents?: true

Size: 250 Bytes

Versions: 3

Compression:

Stored size: 250 Bytes

Contents

module Valvat
  module Utils
    
    COUNTRY_PATTERN = /\A([A-Z]{2})(.+)\Z/
    
    def self.split(vat)
      COUNTRY_PATTERN =~ vat 
      [$1, $2]
    end
    
    def self.normalize(vat)
      vat.upcase.gsub(/\A\s+|\s+\Z/, "")
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
valvat-0.0.3 lib/valvat/utils.rb
valvat-0.0.2 lib/valvat/utils.rb
valvat-0.0.1 lib/valvat/utils.rb