class TZInfo::TransitionRule

:nodoc:
@private
@abstract
savings time.
Base class for rules definining the transition between standard and daylight

def ==(r)

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

Parameters:
  • r (Object) -- the instance to test for equality.
def ==(r)
  r.kind_of?(TransitionRule) && @transition_at == r.transition_at
end

def at(offset, year)

Returns:
  • (TimestampWithOffset) - the time at which the transition occurs.

Parameters:
  • year (Integer) -- the year in which the transition occurs (local
  • offset (TimezoneOffset) -- the current offset at the time the rule
def at(offset, year)
  day = get_day(offset, year)
  TimestampWithOffset.set_timezone_offset(Timestamp.for(day + @transition_at), offset)
end

def hash

Returns:
  • (Integer) - a hash based on {hash_args} (defaulting to
def hash
  hash_args.hash
end

def hash_args

Returns:
  • (Array) - an `Array` of parameters that will influence the output of
def hash_args
  [@transition_at]
end

def initialize(transition_at)

Raises:
  • (ArgumentError) - if `transition_at` is not an `Integer`.

Parameters:
  • transition_at (Integer) -- the time in seconds after midnight local
def initialize(transition_at)
  raise ArgumentError, 'Invalid transition_at' unless transition_at.kind_of?(Integer)
  @transition_at = transition_at
end