Module: TZInfo::CountryIndexDefinition::ClassMethods
- Defined in:
- lib/tzinfo/country_index_definition.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#countries ⇒ Object
Returns a frozen hash of all the countries that have been defined in the index.
-
#country(code, name, &block) ⇒ Object
Defines a country with an ISO 3166 country code, name and block.
Instance Method Details
#countries ⇒ Object
Returns a frozen hash of all the countries that have been defined in the index.
45 46 47 |
# File 'lib/tzinfo/country_index_definition.rb', line 45 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.
39 40 41 |
# File 'lib/tzinfo/country_index_definition.rb', line 39 def country(code, name, &block) @countries[code] = CountryInfo.new(code, name, &block) end |