Class: TZInfo::DataSources::LinkedTimezoneInfo
- Inherits:
-
TimezoneInfo
- Object
- TimezoneInfo
- TZInfo::DataSources::LinkedTimezoneInfo
- 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.
Instance Attribute Summary collapse
-
#link_to_identifier ⇒ String
readonly
(that this zone links to or is an alias for).
Attributes inherited from TimezoneInfo
Instance Method Summary collapse
-
#create_timezone ⇒ LinkedTimezone
A new LinkedTimezone instance for the time zone represented by this LinkedTimezoneInfo.
-
#initialize(identifier, link_to_identifier) ⇒ LinkedTimezoneInfo
constructor
Initializes a new LinkedTimezoneInfo.
Methods inherited from TimezoneInfo
Constructor Details
#initialize(identifier, link_to_identifier) ⇒ LinkedTimezoneInfo
Initializes a new TZInfo::DataSources::LinkedTimezoneInfo. The passed in identifier
and
link_to_identifier
instances will be frozen.
nil
.
20 21 22 23 24 |
# 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
#link_to_identifier ⇒ String (readonly)
(that this zone links to or is an alias for).
10 11 12 |
# File 'lib/tzinfo/data_sources/linked_timezone_info.rb', line 10 def link_to_identifier @link_to_identifier end |
Instance Method Details
#create_timezone ⇒ LinkedTimezone
Returns a new LinkedTimezone instance for the time zone represented by this TZInfo::DataSources::LinkedTimezoneInfo.
28 29 30 |
# File 'lib/tzinfo/data_sources/linked_timezone_info.rb', line 28 def create_timezone LinkedTimezone.new(self) end |