123456789_123456789_123456789_123456789_123456789_

Class: TZInfo::OffsetTimezonePeriod

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: TZInfo::TimezonePeriod
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).

Class Method Summary

TimezonePeriod - Inherited

.new

Initializes a TimezonePeriod.

Instance Attribute Summary

TimezonePeriod - Inherited

#dst?

Determines if daylight savings is in effect (i.e.

#offset

Instance Method Summary

TimezonePeriod - Inherited

#abbr
#abbreviation

The abbreviation that identifies this offset.

#base_utc_offset

Returns the base offset from UTC in seconds (observed_utc_offset - std_offset).

#end_transition,
#ends_at

Returns the UTC end time of the period or nil if the end of the period is unbounded.

#local_ends_at

Returns the local end time of the period or nil if the end of the period is unbounded.

#local_starts_at

Returns the local start time of the period or nil if the start of the period is unbounded.

#observed_utc_offset

Returns the observed offset from UTC in seconds (base_utc_offset + std_offset).

#start_transition,
#starts_at

Returns the UTC start time of the period or nil if the start of the period is unbounded.

#std_offset

Returns the offset from the time zone's standard time in seconds (observed_utc_offset - base_utc_offset).

#utc_offset
#utc_total_offset
#zone_identifier
#raise_not_implemented

Raises a NotImplementedError to indicate that subclasses should override a method.

#timestamp, #timestamp_with_offset

Constructor Details

.new(offset) ⇒ OffsetTimezonePeriod

Initializes an OffsetTimezonePeriod.

Parameters:

Raises:

  • (ArgumentError)

    if offset is nil.

[ GitHub ]

  
# 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 OffsetTimezonePeriod is equal to another instance.

Parameters:

  • p (Object)

    the instance to test for equality.

Returns:

  • (Boolean)

    true if p is a OffsetTimezonePeriod with the same offset, otherwise false.

[ GitHub ]

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

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

#end_transitionTimezoneTransition

Returns:

[ GitHub ]

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

def end_transition
  nil
end

#eql?(p)

Alias for #==.

[ GitHub ]

  
# File 'lib/tzinfo/offset_timezone_period.rb', line 35

alias eql? ==

#hashInteger

Returns:

  • (Integer)

    a hash based on offset.

[ GitHub ]

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

def hash
  offset.hash
end

#start_transitionTimezoneTransition

Returns:

[ GitHub ]

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

def start_transition
  nil
end