Sha256: 8aa7d00f84db0a176f9854f8957813b42bb5eda255b272b9880d78726b276124
Contents?: true
Size: 756 Bytes
Versions: 30
Compression:
Stored size: 756 Bytes
Contents
module TelephoneNumber module ClassMethods attr_accessor :override_file, :default_format_string attr_reader :default_format_pattern def default_format_pattern=(format_string) @default_format_pattern = Regexp.new(format_string) end def parse(number, country = nil) TelephoneNumber::Number.new(number, country) end def valid?(number, country = nil, keys = []) parse(number, country).valid?(keys) end def invalid?(*args) !valid?(*args) end def sanitize(input_number) input_number.to_s.gsub(/\D/, '') end # generates binary file from xml that user gives us def generate_override_file(file) PhoneDataImporter.new(file, override: true).import! end end end
Version data entries
30 entries across 30 versions & 1 rubygems