123456789_123456789_123456789_123456789_123456789_

Class: TZInfo::DataSources::LinkedTimezoneInfo

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, TimezoneInfo
Instance Chain:
self, TimezoneInfo
Inherits: TZInfo::DataSources::TimezoneInfo
Defined in: lib/tzinfo/data_sources/linked_timezone_info.rb

Overview

Represents a time zone that is defined as a link to or alias of another zone.

Class Method Summary

TimezoneInfo - Inherited

.new

Initializes a new TimezoneInfo.

Instance Attribute Summary

TimezoneInfo - Inherited

Instance Method Summary

Constructor Details

.new(identifier, link_to_identifier) ⇒ LinkedTimezoneInfo

Initializes a new LinkedTimezoneInfo. The passed in identifier and #link_to_identifier instances will be frozen.

nil.

Parameters:

  • identifier (String)

    the identifier of the time zone.

  • link_to_identifier (String)

    the identifier of the time zone that this zone link to.

Raises:

[ GitHub ]

  
# File 'lib/tzinfo/data_sources/linked_timezone_info.rb', line 20

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

Instance Attribute Details

Instance Method Details

#create_timezoneLinkedTimezone

Returns:

[ GitHub ]

  
# File 'lib/tzinfo/data_sources/linked_timezone_info.rb', line 28

def create_timezone
  LinkedTimezone.new(self)
end