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