Skip to content

Instantly share code, notes, and snippets.

@masterT
Created January 26, 2015 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masterT/7dd91b19a24c780d4167 to your computer and use it in GitHub Desktop.
Save masterT/7dd91b19a24c780d4167 to your computer and use it in GitHub Desktop.
Issue on phonelib
require 'phonelib'
number = "9549233221"
country = "US"
puts "\nPhonelib.valid_for_country? '#{number}', '#{country}' :"
puts Phonelib.valid_for_country? number, country
phone = Phonelib.parse(number)
puts "\nphone.valid? :"
puts phone.valid?
puts "\nphone.valid_for_country?('#{country}') :"
puts phone.valid_for_country?(country)
# why this is not valid ?
# with default country
Phonelib.default_country = "US"
puts "\nPhonelib.valid_for_country? '#{number}', '#{country}' :"
puts Phonelib.valid_for_country? number, country
phone = Phonelib.parse(number)
puts "\nphone.valid? : "
puts phone.valid?
puts "\nphone.valid_for_country?('#{country}') :"
puts phone.valid_for_country?(country)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment