Closed shqear93 closed 3 years ago
@shqear93 Hi, what happens here, is that when you are not specifying country gem tries to guess it. And it can't guess to add "1" as country prefix. When you run Phonelib.parse('6135550130').valid_for_country? 'CA'
gem executes Phonelib.parse('6135550130', :ca)
. You have several options here:
Phonelib.default_country
to :ca
, in order to help gem to guess the countryPhonelib.parse('6135550130', :ca)
@daddyz Thanks for your response, I actually still confused about valid_countries
, isn't supposed to try the validity of the number provided against all countries?
My test case:
Phone number:
6135550130
- CanadianWhat is Expected:
this might be valid only for canadian numbers