Module: TZInfo::CountryIndexDefinition::ClassMethods

Defined in:
lib/tzinfo/country_index_definition.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#countriesObject

Returns a frozen hash of all the countries that have been defined in the index.



43
44
45
# File 'lib/tzinfo/country_index_definition.rb', line 43

def countries
  @countries.freeze
end

#country(code, name, &block) ⇒ Object

Defines a country with an ISO 3166 country code, name and block. The block will be evaluated to obtain all the timezones for the country. Calls Country.country_defined with the definition of each country.



37
38
39
# File 'lib/tzinfo/country_index_definition.rb', line 37

def country(code, name, &block)
  @countries[code] = CountryInfo.new(code, name, &block)      
end