class TZInfo::TimezoneOffsetInfo
:nodoc:
Represents an offset defined in a Timezone data file.
def ==(toi)
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?
def dst? @std_offset != 0 end
def eql?(toi)
Returns true if and only if toi has the same utc_offset, std_offset
def eql?(toi) self == toi end
def hash
def hash utc_offset.hash ^ std_offset.hash ^ abbreviation.hash end
def initialize(utc_offset, std_offset, abbreviation)
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
def inspect "#<#{self.class}: #@utc_offset,#@std_offset,#@abbreviation>" end
def to_local(utc)
def to_local(utc) TimeOrDateTime.wrap(utc) {|wrapped| wrapped + @utc_total_offset } end
def to_utc(local)
def to_utc(local) TimeOrDateTime.wrap(local) {|wrapped| wrapped - @utc_total_offset } end