class TZInfo::LinkedTimezone

Represents time zones that are defined as a link to or alias for another time zone.

Public Class Methods

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}.
Calls superclass method TZInfo::InfoTimezone::new
# File lib/tzinfo/linked_timezone.rb, line 15
def initialize(info)
  super
  @linked_timezone = Timezone.get(info.link_to_identifier)
end

Public Instance Methods

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}.

# File lib/tzinfo/linked_timezone.rb, line 40
def canonical_zone
  @linked_timezone.canonical_zone
end

(see Timezone#period_for)

# File lib/tzinfo/linked_timezone.rb, line 21
def period_for(time)
  @linked_timezone.period_for(time)
end

(see Timezone#periods_for_local)

# File lib/tzinfo/linked_timezone.rb, line 26
def periods_for_local(local_time)
  @linked_timezone.periods_for_local(local_time)
end

(see Timezone#transitions_up_to)

# File lib/tzinfo/linked_timezone.rb, line 31
def transitions_up_to(to, from = nil)
  @linked_timezone.transitions_up_to(to, from)
end