Class: TZInfo::Format2::TimezoneIndexDefiner
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tzinfo-2.0.5/lib/tzinfo/format2/timezone_index_definer.rb
Overview
Instances of TimezoneIndexDefiner are yielded by TimezoneIndexDefinition to allow the time zone index to be defined.
Instance Attribute Summary collapse
-
#data_timezones ⇒ Array<String>
readonly
The identifiers of all data time zones.
-
#linked_timezones ⇒ Array<String>
readonly
The identifiers of all linked time zones.
Instance Method Summary collapse
-
#data_timezone(identifier) ⇒ Object
Adds a data time zone to the index.
-
#initialize(string_deduper) ⇒ TimezoneIndexDefiner
constructor
Initializes a new TimezoneDefiner.
-
#linked_timezone(identifier) ⇒ Object
Adds a linked time zone to the index.
Constructor Details
#initialize(string_deduper) ⇒ TimezoneIndexDefiner
Initializes a new TimezoneDefiner.
20 21 22 23 24 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tzinfo-2.0.5/lib/tzinfo/format2/timezone_index_definer.rb', line 20 def initialize(string_deduper) @string_deduper = string_deduper @data_timezones = [] @linked_timezones = [] end |
Instance Attribute Details
Instance Method Details
#data_timezone(identifier) ⇒ Object
Adds a data time zone to the index.
29 30 31 32 33 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tzinfo-2.0.5/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) ⇒ Object
Adds a linked time zone to the index.
38 39 40 41 42 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tzinfo-2.0.5/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 |