class TZInfo::TimezoneOffset

Experimental RBS support (using type sampling data from the type_fusion project).

# sig/tzinfo/timezone_offset.rbs

class TZInfo::TimezoneOffset
  def initialize: (Integer base_utc_offset, Integer std_offset, String abbreviation) -> void
end

Represents an offset from UTC observed by a time zone.

def ==(toi)

Returns:
  • (Boolean) - `true` if `toi` is a {TimezoneOffset} with the same

Parameters:
  • toi (Object) -- the instance to test for equality.
def ==(toi)
  toi.kind_of?(TimezoneOffset) &&
    base_utc_offset == toi.base_utc_offset && std_offset == toi.std_offset && abbreviation == toi.abbreviation
end

def dst?

Returns:
  • (Boolean) - `true` if {std_offset} is non-zero, otherwise `false`.
def dst?
  @std_offset != 0
end

def eql?(toi)

Returns:
  • (Boolean) - `true` if `toi` is a {TimezoneOffset} with the same

Parameters:
  • toi (Object) -- the instance to test for equality.
def eql?(toi)
  self == toi
end

def hash

Returns:
  • (Integer) - a hash based on {utc_offset}, {std_offset} and
def hash
  [@base_utc_offset, @std_offset, @abbreviation].hash
end

def initialize(base_utc_offset, std_offset, abbreviation)

Experimental RBS support (using type sampling data from the type_fusion project).

def initialize: (Integer base_utc_offset, Integer std_offset, String abbreviation) -> void

This signature was generated using 6 samples from 1 application.

Parameters:
  • abbreviation (String) -- the abbreviation identifying the offset.
  • std_offset (Integer) -- the offset from standard time in seconds.
  • base_utc_offset (Integer) -- the base offset from UTC in seconds.
def initialize(base_utc_offset, std_offset, abbreviation)
  @base_utc_offset = base_utc_offset
  @std_offset = std_offset
  @abbreviation = abbreviation.freeze
  @observed_utc_offset = @base_utc_offset + @std_offset
end

def inspect

Returns:
  • (String) - the internal object state as a programmer-readable
def inspect
  "#<#{self.class}: @base_utc_offset=#{@base_utc_offset}, @std_offset=#{@std_offset}, @abbreviation=#{@abbreviation}>"
end