lib/phonelib/data_importer.rb
# method finds country by country prefix
method finds country by country prefix
method finds country by country prefix
def country_by_code(country_code)
        match = @data.select { |_k, v| v[:country_code] == country_code }
        if match.size > 1
          match = match.select { |_k, v| v[:main_country_for_code] == 'true' }
        end
        match.keys.first
      end
def country_by_code ( country_code ) match = @data . select { | _k , v | v [ :country_code ] == country_code } if match . size > 1 match = match . select { | _k , v | v [ :main_country_for_code ] == 'true' } end match . keys . first end
method finds country by country prefix
method finds country by country prefix
country_code
<not_specific>