Class: RRule::SimpleWeekly
- Defined in:
- lib/rrule/frequencies/simple_weekly.rb
Instance Attribute Summary
Attributes inherited from Frequency
#current_date, #filters, #generator, #timeset
Instance Method Summary collapse
Methods inherited from Frequency
#advance, for_options, #initialize
Constructor Details
This class inherits a constructor from RRule::Frequency
Instance Method Details
#correct_current_date_if_needed ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/rrule/frequencies/simple_weekly.rb', line 12 def correct_current_date_if_needed target_wday = if context.[:byweekday].present? context.[:byweekday].first.index else context.dtstart.wday end @current_date += 1.day while @current_date.wday != target_wday end |
#next_occurrences ⇒ Object
5 6 7 8 9 10 |
# File 'lib/rrule/frequencies/simple_weekly.rb', line 5 def next_occurrences correct_current_date_if_needed this_occurrence = current_date @current_date += context.[:interval].weeks generator.process_timeset(this_occurrence, timeset) end |