Class IceCube::WeeklyRule
In: lib/ice_cube/rules/weekly_rule.rb
Parent: ValidatedRule

Methods

new   realign   wday_offset  

Included Modules

Validations::HourOfDay Validations::MinuteOfHour Validations::SecondOfMinute Validations::DayOfWeek Validations::Day Validations::MonthOfYear Validations::WeeklyInterval

Attributes

week_start  [R] 

Public Class methods

Public Instance methods

Move the effective start time to correct for when the schedule has validations earlier in the week than the selected start time, e.g.

    Schedule.new(wednesday).weekly(2).day(:monday)

The effective start time gets realigned to the second next Monday, jumping over the gap week for the interval (2). Without realignment, the correct Monday occurrence would be missed when the schedule performs a 7-day jump into the next interval week, arriving on the Wednesday. This corrects any selections from dates that are misaligned to the schedule interval.

Calculate how many days to the first wday validation in the correct interval week. This may move backwards within the week if starting in an interval week with earlier validations.

[Validate]