Class: TZInfo::OffsetTimezonePeriod

Inherits:
TimezonePeriod show all
Defined in:
lib/tzinfo/offset_timezone_period.rb

Overview

Represents the infinite period of time in a time zone that constantly observes the same offset from UTC (has an unbounded start and end).

Instance Attribute Summary

Attributes inherited from TimezonePeriod

#offset

Instance Method Summary collapse

Methods inherited from TimezonePeriod

#abbreviation, #base_utc_offset, #dst?, #ends_at, #local_ends_at, #local_starts_at, #observed_utc_offset, #starts_at, #std_offset

Constructor Details

#initialize(offset) ⇒ OffsetTimezonePeriod

Parameters:

Raises:

  • (ArgumentError)

    if offset is nil.



11
12
13
# File 'lib/tzinfo/offset_timezone_period.rb', line 11

def initialize(offset)
  super
end

Instance Method Details

#==(p) ⇒ Boolean Also known as: eql?

Determines if this TZInfo::OffsetTimezonePeriod is equal to another instance.

Parameters:

  • p (Object)

    the instance to test for equality.

Returns:



32
33
34
# File 'lib/tzinfo/offset_timezone_period.rb', line 32

def ==(p)
  p.kind_of?(OffsetTimezonePeriod) && offset == p.offset
end

#end_transitionTimezoneTransition

Returns the transition that defines the end of this TimezonePeriod, always nil for TZInfo::OffsetTimezonePeriod.

Returns:



23
24
25
# File 'lib/tzinfo/offset_timezone_period.rb', line 23

def end_transition
  nil
end

#hashInteger

Returns a hash based on TimezonePeriod#offset.

Returns:



38
39
40
# File 'lib/tzinfo/offset_timezone_period.rb', line 38

def hash
  offset.hash
end

#start_transitionTimezoneTransition

Returns the transition that defines the start of this TimezonePeriod, always nil for TZInfo::OffsetTimezonePeriod.

Returns:



17
18
19
# File 'lib/tzinfo/offset_timezone_period.rb', line 17

def start_transition
  nil
end