Created
January 26, 2015 19:12
-
-
Save masterT/7dd91b19a24c780d4167 to your computer and use it in GitHub Desktop.
Issue on phonelib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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