Sha256: 17c87a4812d36847111671a6d0d2b1a9abc9d1735d873447591c9866596da7fa

Contents?: true

Size: 1.39 KB

Versions: 46

Compression:

Stored size: 1.39 KB

Contents

# encoding: UTF-8

module TZInfo
  module Format2
    # The format 2 country index file includes
    # {Format2::CountryIndexDefinition}, which provides a
    # {CountryIndexDefinition::ClassMethods#country_index country_index} method
    # used to define the country index.
    #
    # @private
    module CountryIndexDefinition #:nodoc:
      # Adds class methods to the includee and initializes class instance
      # variables.
      #
      # @param base [Module] the includee.
      def self.append_features(base)
        super
        base.extend(ClassMethods)
        base.instance_eval { @countries = {}.freeze }
      end

      # Class methods for inclusion.
      #
      # @private
      module ClassMethods #:nodoc:
        # @return [Hash<String, DataSources::CountryInfo>] a frozen `Hash`
        #   of all the countries that have been defined in the index keyed by
        #   their codes.
        attr_reader :countries

        private

        # Defines the index.
        #
        # @yield [definer] yields to allow the index to be defined.
        # @yieldparam definer [CountryIndexDefiner] a {CountryIndexDefiner}
        #   instance that should be used to define the index.
        def country_index
          definer = CountryIndexDefiner.new(StringDeduper.global, StringDeduper.new)
          yield definer
          @countries = definer.countries.freeze
        end
      end
    end
  end
end

Version data entries

46 entries across 41 versions & 22 rubygems

Version Path
tailscale_middleware-0.0.3 vendor/cache/ruby/3.4.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/country_index_definition.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/country_index_definition.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/country_index_definition.rb
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/country_index_definition.rb
fluent-plugin-nuopenlineage-light-0.1.0 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/country_index_definition.rb
fluent-plugin-openlineage-light-0.1.4 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/country_index_definition.rb
fluent-plugin-openlineage-light-0.1.3 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/country_index_definition.rb
fluent-plugin-openlineage-0.1.0 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/country_index_definition.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/country_index_definition.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/country_index_definition.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/country_index_definition.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/country_index_definition.rb
katalyst-govuk-formbuilder-1.9.2 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/country_index_definition.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/country_index_definition.rb
mlh-rubocop-config-1.0.3 vendor/bundle/ruby/3.2.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/country_index_definition.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/country_index_definition.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/tzinfo-2.0.5/lib/tzinfo/format2/country_index_definition.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/tzinfo-2.0.4/lib/tzinfo/format2/country_index_definition.rb
mlh-rubocop-config-1.0.2 vendor/bundle/ruby/3.2.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/country_index_definition.rb
fablicop-1.10.3 vendor/bundle/ruby/3.2.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/country_index_definition.rb