Class: TZInfo::Format2::TimezoneIndexDefiner Private
Do not use. This class is for internal use only.
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/tzinfo/format2/timezone_index_definer.rb |
Overview
Instances of TimezoneIndexDefiner
are yielded by
TimezoneIndexDefinition
to allow the time zone index to be defined.
Class Method Summary
-
.new(string_deduper) ⇒ TimezoneIndexDefiner
constructor
Internal use only
Initializes a new
TimezoneDefiner
.
Instance Attribute Summary
- #data_timezones ⇒ Array<String> readonly Internal use only
- #linked_timezones ⇒ Array<String> readonly Internal use only
Instance Method Summary
-
#data_timezone(identifier)
Internal use only
Adds a data time zone to the index.
-
#linked_timezone(identifier)
Internal use only
Adds a linked time zone to the index.
Instance Attribute Details
#data_timezones ⇒ Array
<String
> (readonly)
# File 'lib/tzinfo/format2/timezone_index_definer.rb', line 11
attr_reader :data_timezones
#linked_timezones ⇒ Array
<String
> (readonly)
# File 'lib/tzinfo/format2/timezone_index_definer.rb', line 14
attr_reader :linked_timezones
Instance Method Details
#data_timezone(identifier)
Adds a data time zone to the index.
# File 'lib/tzinfo/format2/timezone_index_definer.rb', line 29
def data_timezone(identifier) # Dedupe non-frozen literals from format 1 on all Ruby versions and # format 2 on Ruby < 2.3 (without frozen_string_literal support). @data_timezones << @string_deduper.dedupe(identifier) end
#linked_timezone(identifier)
Adds a linked time zone to the index.
# File 'lib/tzinfo/format2/timezone_index_definer.rb', line 38
def linked_timezone(identifier) # Dedupe non-frozen literals from format 1 on all Ruby versions and # format 2 on Ruby < 2.3 (without frozen_string_literal support). @linked_timezones << @string_deduper.dedupe(identifier) end