class GenesisRuby::Utils::Country

rubocop:disable Metrics/ClassLength
Country-related methods

def country_iso(country_name)

Retrieves a country's ISO code by its name.
def country_iso(country_name)
  country_pair = COUNTRIES.find { |_iso, name| name.downcase == country_name.downcase }
  country_pair&.first
end

def country_name(iso_code)

Retrieves a country's name by its ISO code.
def country_name(iso_code)
  COUNTRIES.fetch(iso_code, false)
end

def list

Returns a list of all supported country ISO codes.
def list
  COUNTRIES.keys
end