Sha256: 87480986259502f15b069d1dc6d75f743c66f02feae06435e53ed3685f7dae31

Contents?: true

Size: 1.35 KB

Versions: 43

Compression:

Stored size: 1.35 KB

Contents

# encoding: UTF-8

module TZInfo
  # Represents time zones that are defined as a link to or alias for another
  # time zone.
  class LinkedTimezone < InfoTimezone
    # Initializes a new {LinkedTimezone}.
    #
    # {LinkedTimezone} instances should not normally be created directly. Use
    # the {Timezone.get} method to obtain {Timezone} instances.
    #
    # @param info [DataSources::LinkedTimezoneInfo] a
    #   {DataSources::LinkedTimezoneInfo} instance supplied by a {DataSource}
    #   that will be used as the source of data for this {LinkedTimezone}.
    def initialize(info)
      super
      @linked_timezone = Timezone.get(info.link_to_identifier)
    end

    # (see Timezone#period_for)
    def period_for(time)
      @linked_timezone.period_for(time)
    end

    # (see Timezone#periods_for_local)
    def periods_for_local(local_time)
      @linked_timezone.periods_for_local(local_time)
    end

    # (see Timezone#transitions_up_to)
    def transitions_up_to(to, from = nil)
      @linked_timezone.transitions_up_to(to, from)
    end

    # Returns the canonical {Timezone} instance for this {LinkedTimezone}.
    #
    # For a {LinkedTimezone}, this is the canonical zone of the link target.
    #
    # @return [Timezone] the canonical {Timezone} instance for this {Timezone}.
    def canonical_zone
      @linked_timezone.canonical_zone
    end
  end
end

Version data entries

43 entries across 39 versions & 20 rubygems

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