class TZInfo::AbsoluteDayOfYearTransitionRule

:nodoc:
@private
the following year on a non-leap year.
on a non-leap year. Day 365 will be 31 December on a leap year and 1 January
Leap days are counted. Day 59 will be 29 February on a leap year and 1 March
Day 0 is 1 January.
Defines transitions that occur on the zero-based nth day of the year.

def ==(r)

Returns:
  • (Boolean) - `true` if `r` is a {AbsoluteDayOfYearTransitionRule}

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

def get_day(offset, year)

Returns:
  • (Time) - midnight local time on the day specified by the rule for

Parameters:
  • year (Integer) -- the year in which the transition occurs.
  • offset (TimezoneOffset) -- the current offset at the time of the
def get_day(offset, year)
  Time.new(year, 1, 1, 0, 0, 0, offset.observed_utc_offset) + seconds
end

def hash_args

(see TransitionRule#hash_args)
def hash_args
  [AbsoluteDayOfYearTransitionRule] + super
end

def initialize(day, transition_at = 0)

Raises:
  • (ArgumentError) - if `day` is less than 0 or greater than 365.
  • (ArgumentError) - if `day` is not an `Integer`.
  • (ArgumentError) - if `transition_at` is not an `Integer`.

Parameters:
  • transition_at (Integer) -- the time in seconds after midnight local
  • day (Integer) -- the zero-based day of the year on which the

Other tags:
    Private: -
def initialize(day, transition_at = 0)
  super(day, transition_at)
  raise ArgumentError, 'Invalid day' unless day >= 0 && day <= 365
end

def is_always_first_day_of_year?

Returns:
  • (Boolean) - `true` if the day specified by this transition is the
def is_always_first_day_of_year?
  seconds == 0
end

def is_always_last_day_of_year?

Returns:
  • (Boolean) - `false`.
def is_always_last_day_of_year?
  false
end