Sha256: d354229133e26f99fef333273b0b9acbf34f92e05d855a783b1400f0484b5446

Contents?: true

Size: 1.2 KB

Versions: 45

Compression:

Stored size: 1.2 KB

Contents

# encoding: UTF-8

module TZInfo
  module DataSources
    # Represents a time zone that is defined as a link to or alias of another
    # zone.
    class LinkedTimezoneInfo < TimezoneInfo
      # @return [String] the identifier of the time zone that provides the data
      # (that this zone links to or is an alias for).
      attr_reader :link_to_identifier

      # Initializes a new {LinkedTimezoneInfo}. The passed in `identifier` and
      # `link_to_identifier` instances will be frozen.
      #
      # @param identifier [String] the identifier of the time zone.
      # @param link_to_identifier [String] the identifier of the time zone that
      #   this zone link to.
      # @raise [ArgumentError] if `identifier` or `link_to_identifier` are
      # `nil`.
      def initialize(identifier, link_to_identifier)
        super(identifier)
        raise ArgumentError, 'link_to_identifier must be specified' unless link_to_identifier
        @link_to_identifier = link_to_identifier.freeze
      end

      # @return [LinkedTimezone] a new {LinkedTimezone} instance for the time
      #   zone represented by this {LinkedTimezoneInfo}.
      def create_timezone
        LinkedTimezone.new(self)
      end
    end
  end
end

Version data entries

45 entries across 40 versions & 21 rubygems

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