class TZInfo::OffsetTimezonePeriod
Represents the infinite period of time in a time zone that constantly observes the same offset from UTC (has an unbounded start and end).
Public Class Methods
Initializes an {OffsetTimezonePeriod}.
@param offset [TimezoneOffset] the offset that is constantly observed. @raise [ArgumentError] if ‘offset` is `nil`.
Calls superclass method
# File lib/tzinfo/offset_timezone_period.rb, line 11 def initialize(offset) super end
Public Instance Methods
Determines if this {OffsetTimezonePeriod} is equal to another instance.
@param p [Object] the instance to test for equality. @return [Boolean] ‘true` if `p` is a {OffsetTimezonePeriod} with the same
{offset}, otherwise `false`.
# File lib/tzinfo/offset_timezone_period.rb, line 32 def ==(p) p.kind_of?(OffsetTimezonePeriod) && offset == p.offset end
Also aliased as: eql?
@return [TimezoneTransition] the transition that defines the end of this
{TimezonePeriod}, always `nil` for {OffsetTimezonePeriod}.
# File lib/tzinfo/offset_timezone_period.rb, line 23 def end_transition nil end
@return [Integer] a hash based on {offset}.
# File lib/tzinfo/offset_timezone_period.rb, line 38 def hash offset.hash end
@return [TimezoneTransition] the transition that defines the start of this
{TimezonePeriod}, always `nil` for {OffsetTimezonePeriod}.
# File lib/tzinfo/offset_timezone_period.rb, line 17 def start_transition nil end