lib/phonelib/core.rb in phonelib-0.1.1 vs lib/phonelib/core.rb in phonelib-0.1.2
- old
+ new
@@ -121,14 +121,16 @@
parse(phone_number).impossible?
end
# method checks if passed phone number is valid for provided country
def valid_for_country?(phone_number, country)
+ country = country.to_s.upcase
parse(phone_number, country).valid_for_country?(country)
end
# method checks if passed phone number is invalid for provided country
def invalid_for_country?(phone_number, country)
+ country = country.to_s.upcase
parse(phone_number, country).invalid_for_country?(country)
end
private
def convert_phone_to_e164(phone, prefix, national_prefix)