module TZInfo::Format1::CountryIndexDefinition::ClassMethods

def countries

Returns:
  • (Hash) - a frozen `Hash`

Other tags:
    Private: -
def countries
  @description_deduper = nil
  @countries.freeze
end

def country(code, name)

Other tags:
    Yieldparam: definer - a {CountryDefiner} instance.

Other tags:
    Yield: - (optional) to obtain the time zones for the country.

Parameters:
  • name (String) -- the name of the country.
  • code (String) -- the ISO 3166-1 alpha-2 country code.
def country(code, name)
  @description_deduper ||= StringDeduper.new
  zones = if block_given?
    definer = CountryDefiner.new(StringDeduper.global, @description_deduper)
    yield definer
    definer.timezones
  else
    []
  end
  @countries[code.freeze] = DataSources::CountryInfo.new(code, name, zones)
end