Sha256: 8f94de28d5a7deec768fb7ba4a58ba58326bdb47e55f3e3cee2fb6eb6554ccc3

Contents?: true

Size: 962 Bytes

Versions: 77

Compression:

Stored size: 962 Bytes

Contents

module TZInfo
  # The country index file includes CountryIndexDefinition which provides
  # a country method used to define each country in the index.
  #
  # @private
  module CountryIndexDefinition #:nodoc:
    def self.append_features(base)
      super
      base.extend(ClassMethods)
      base.instance_eval { @countries = {} }
    end
    
    # Class methods for inclusion.
    #
    # @private
    module ClassMethods #:nodoc:
      # 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.
      def country(code, name, &block)
        @countries[code] = RubyCountryInfo.new(code, name, &block)      
      end
      
      # Returns a frozen hash of all the countries that have been defined in
      # the index.
      def countries
        @countries.freeze
      end
    end
  end
end

Version data entries

77 entries across 73 versions & 27 rubygems

Version Path
mumukit-content-type-1.12.1 vendor/bundle/ruby/2.7.0/gems/tzinfo-1.2.11/lib/tzinfo/country_index_definition.rb
mumukit-content-type-1.12.0 vendor/bundle/ruby/2.7.0/gems/tzinfo-1.2.11/lib/tzinfo/country_index_definition.rb
tzinfo-1.2.11 lib/tzinfo/country_index_definition.rb
tzinfo-1.2.10 lib/tzinfo/country_index_definition.rb
mumukit-content-type-1.11.1 vendor/bundle/ruby/2.6.0/gems/tzinfo-1.2.9/lib/tzinfo/country_index_definition.rb
tzinfo-1.2.9 lib/tzinfo/country_index_definition.rb
tzinfo-1.2.8 lib/tzinfo/country_index_definition.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/tzinfo-1.2.7/lib/tzinfo/country_index_definition.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/tzinfo-1.2.6/lib/tzinfo/country_index_definition.rb
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/tzinfo-1.2.5/lib/tzinfo/country_index_definition.rb
tzinfo-1.2.7 lib/tzinfo/country_index_definition.rb
argon-1.3.1 vendor/bundle/ruby/2.7.0/gems/tzinfo-1.2.6/lib/tzinfo/country_index_definition.rb
symbolic_enum-1.1.5 vendor/bundle/ruby/2.7.0/gems/tzinfo-1.2.6/lib/tzinfo/country_index_definition.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.4.0/gems/tzinfo-1.2.6/lib/tzinfo/country_index_definition.rb
tzinfo-1.2.6 lib/tzinfo/country_index_definition.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/tzinfo-1.2.5/lib/tzinfo/country_index_definition.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/tzinfo-1.2.5/lib/tzinfo/country_index_definition.rb
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/tzinfo-1.2.5/lib/tzinfo/country_index_definition.rb
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/tzinfo-1.2.5/lib/tzinfo/country_index_definition.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/tzinfo-1.2.5/lib/tzinfo/country_index_definition.rb