Sha256: 8e78339e9a480ca99a91a28b5fb4f78384cf9ddaa3fca3d3b63b2e9320d3d8c2

Contents?: true

Size: 1.51 KB

Versions: 46

Compression:

Stored size: 1.51 KB

Contents

# encoding: UTF-8

module TZInfo
  module Format2
    # Instances of {TimezoneIndexDefiner} are yielded by
    # {TimezoneIndexDefinition} to allow the time zone index to be defined.
    #
    # @private
    class TimezoneIndexDefiner #:nodoc:
      # @return [Array<String>] the identifiers of all data time zones.
      attr_reader :data_timezones

      # @return [Array<String>] the identifiers of all linked time zones.
      attr_reader :linked_timezones

      # Initializes a new TimezoneDefiner.
      #
      # @param string_deduper [StringDeduper] a {StringDeduper} instance to use
      #   when deduping identifiers.
      def initialize(string_deduper)
        @string_deduper = string_deduper
        @data_timezones = []
        @linked_timezones = []
      end

      # Adds a data time zone to the index.
      #
      # @param identifier [String] the time zone identifier.
      def data_timezone(identifier)
        # Dedupe non-frozen literals from format 1 on all Ruby versions and
        # format 2 on Ruby < 2.3 (without frozen_string_literal support).
        @data_timezones << @string_deduper.dedupe(identifier)
      end

      # Adds a linked time zone to the index.
      #
      # @param identifier [String] the time zone identifier.
      def linked_timezone(identifier)
        # Dedupe non-frozen literals from format 1 on all Ruby versions and
        # format 2 on Ruby < 2.3 (without frozen_string_literal support).
        @linked_timezones << @string_deduper.dedupe(identifier)
      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/timezone_index_definer.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/timezone_index_definer.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/timezone_index_definer.rb
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/timezone_index_definer.rb
fluent-plugin-nuopenlineage-light-0.1.0 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/timezone_index_definer.rb
fluent-plugin-openlineage-light-0.1.4 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/timezone_index_definer.rb
fluent-plugin-openlineage-light-0.1.3 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/timezone_index_definer.rb
fluent-plugin-openlineage-0.1.0 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/timezone_index_definer.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/timezone_index_definer.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/timezone_index_definer.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/timezone_index_definer.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/timezone_index_definer.rb
katalyst-govuk-formbuilder-1.9.2 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/timezone_index_definer.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/timezone_index_definer.rb
mlh-rubocop-config-1.0.3 vendor/bundle/ruby/3.2.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/timezone_index_definer.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/timezone_index_definer.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/tzinfo-2.0.5/lib/tzinfo/format2/timezone_index_definer.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/tzinfo-2.0.4/lib/tzinfo/format2/timezone_index_definer.rb
mlh-rubocop-config-1.0.2 vendor/bundle/ruby/3.2.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/timezone_index_definer.rb
fablicop-1.10.3 vendor/bundle/ruby/3.2.0/gems/tzinfo-2.0.6/lib/tzinfo/format2/timezone_index_definer.rb