module TZInfo::Format2::TimezoneDefinition::ClassMethods

def get

Returns:
  • (TimezoneInfo) - the last time zone to be defined.

Other tags:
    Private: -
def get
  @timezone
end

def linked_timezone(identifier, link_to_identifier)

Parameters:
  • link_to_identifier (String) -- the identifier the new time zone
  • identifier (String) -- the identifier of the time zone being
def linked_timezone(identifier, link_to_identifier)
  # Dedupe non-frozen literals from format 1 on all Ruby versions and
  # format 2 on Ruby < 2.3 (without frozen_string_literal support).
  string_deduper = StringDeduper.global
  @timezone = DataSources::LinkedTimezoneInfo.new(string_deduper.dedupe(identifier), string_deduper.dedupe(link_to_identifier))
end

def timezone(identifier)

Other tags:
    Yieldparam: definer - an instance of the class returned by

Other tags:
    Yield: - yields to the caller to define the time zone.

Parameters:
  • identifier (String) -- the identifier of the time zone.
def 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).
  string_deduper = StringDeduper.global
  identifier = string_deduper.dedupe(identifier)
  definer = timezone_definer_class.new(string_deduper)
  yield definer
  transitions = definer.transitions
  @timezone = if transitions.empty?
    DataSources::ConstantOffsetDataTimezoneInfo.new(identifier, definer.first_offset)
  else
    DataSources::TransitionsDataTimezoneInfo.new(identifier, transitions)
  end
end

def timezone_definer_class

Returns:
  • (Class) - the class to be instantiated and yielded by
def timezone_definer_class
  TimezoneDefiner
end