class TZInfo::TimezoneOffsetInfo

:nodoc:
Represents an offset defined in a Timezone data file.

def ==(toi)

and abbreviation as this TimezoneOffsetInfo.
Returns true if and only if toi has the same utc_offset, std_offset
def ==(toi)
  toi.respond_to?(:utc_offset) && toi.respond_to?(:std_offset) && toi.respond_to?(:abbreviation) &&
    utc_offset == toi.utc_offset && std_offset == toi.std_offset && abbreviation == toi.abbreviation
end

def dst?

True if std_offset is non-zero.
def dst?
  @std_offset != 0
end

def eql?(toi)

and abbreviation as this TimezoneOffsetInfo.
Returns true if and only if toi has the same utc_offset, std_offset
def eql?(toi)
  self == toi
end

def hash

Returns a hash of this TimezoneOffsetInfo.
def hash
  utc_offset.hash ^ std_offset.hash ^ abbreviation.hash
end

def initialize(utc_offset, std_offset, abbreviation)

specified in seconds.
Constructs a new TimezoneOffsetInfo. utc_offset and std_offset are
def initialize(utc_offset, std_offset, abbreviation)
  @utc_offset = utc_offset
  @std_offset = std_offset      
  @abbreviation = abbreviation
  
  @utc_total_offset = @utc_offset + @std_offset
end

def inspect

Returns internal object state as a programmer-readable string.
def inspect
  "#<#{self.class}: #@utc_offset,#@std_offset,#@abbreviation>"
end

def to_local(utc)

Converts a UTC DateTime to local time based on the offset of this period.
def to_local(utc)
  TimeOrDateTime.wrap(utc) {|wrapped|
    wrapped + @utc_total_offset
  }
end

def to_utc(local)

Converts a local DateTime to UTC based on the offset of this period.
def to_utc(local)
  TimeOrDateTime.wrap(local) {|wrapped|
    wrapped - @utc_total_offset
  }
end