Module: TZInfo::Format1::CountryIndexDefinition::ClassMethods Private
Do not use. This module is for internal use only.
Relationships & Source Files | |
Defined in: | lib/tzinfo/format1/country_index_definition.rb |
Overview
Class methods for inclusion.
Instance Method Summary
- #countries ⇒ Hash<String, DataSources::CountryInfo> Internal use only
-
#country(code, name) {|definer| ... }
private
Internal use only
Defines a country with an ISO 3166-1 alpha-2 country code and name.
Instance Method Details
#countries ⇒ Hash
<String
, DataSources::CountryInfo>
# File 'lib/tzinfo/format1/country_index_definition.rb', line 29
def countries @description_deduper = nil @countries.freeze end
#country(code, name) {|definer| ... } (private)
Defines a country with an ISO 3166-1 alpha-2 country code and name.
# File 'lib/tzinfo/format1/country_index_definition.rb', line 42
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