module Geolookup::Country

Constants

COUNTRY_CODE_TO_NAME_FILE
COUNTRY_LAT_LONG_FILE
COUNTRY_NAME_TO_CODE_FILE

Public Class Methods

code_to_name(country_code) click to toggle source
# File lib/geolookup/country.rb, line 26
def self.code_to_name(country_code)
  @country_code_to_name ||= Geolookup.load_hash_from_file(COUNTRY_CODE_TO_NAME_FILE)
  @country_code_to_name[country_code.to_s.upcase]
end
name_to_code(country_name) click to toggle source
# File lib/geolookup/country.rb, line 21
def self.name_to_code(country_name)
  @country_name_to_code ||= Geolookup.load_hash_from_file(COUNTRY_NAME_TO_CODE_FILE)
  @country_name_to_code[country_name.to_s.upcase]
end
name_to_lat_long(country_name) click to toggle source

def self.code_to_lat_long(country_code)

LAT_LONG[country_code.to_s.upcase]

end

# File lib/geolookup/country.rb, line 35
def self.name_to_lat_long(country_name)
  @country_lat_long ||= Geolookup.load_hash_from_file(COUNTRY_LAT_LONG_FILE)
  @country_lat_long[country_name.to_s.upcase]
end