lib/phonelib/phone.rb
# Returns whether a current parsed phone number is valid for specified
# country
# @param country [String|Symbol] ISO code of country (2 letters) like 'US',
#   'us' or :us for United States
# @return [Boolean] parsed phone number is valid
Returns whether a current parsed phone number is valid for specified
country
Returns whether a current parsed phone number is valid for specified country
def valid_for_country?(country)
      country = country.to_s.upcase
      tdata = analyze(sanitized, passed_country(country))
      tdata.find do |iso2, data|
        country == iso2 && data[:valid].any?
      end.is_a? Array
    end
def valid_for_country? ( country ) country = country . to_s . upcase tdata = analyze ( sanitized , passed_country ( country ) ) tdata . find do | iso2 , data | country == iso2 && data [ :valid ] . any? end . is_a? Array end
Returns whether a current parsed phone number is valid for specified
country
Returns whether a current parsed phone number is valid for specified country
parsed phone number is valid
parsed phone number is valid
Boolean
country
ISO code of country (2 letters) like 'US', 'us' or :us for United States
ISO code of country ( 2 letters ) like ' US ' ' us ' or : us for United States