Class: RiCal::PropertyValue::RecurrenceRule::WeeklyIncrementer

Inherits:
FrequencyIncrementer show all
Defined in:
lib/ri_cal/property_value/recurrence_rule/occurence_incrementer.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Attributes inherited from FrequencyIncrementer

#interval, #outer_occurrence, #skip_increment

Attributes inherited from OccurrenceIncrementer

#contains_daily_incrementer, #contains_weeknum_incrementer, #current_occurrence, #leaf_iterator, #outer_incrementers, #outer_range, #sub_cycle_incrementer

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from FrequencyIncrementer

conditional_incrementer, #first_within_outer_cycle, #next_cycle, #step

Methods inherited from OccurrenceIncrementer

#add_outer_incrementer, #contains_daily_incrementer?, #contains_weeknum_incrementer?, #daily_incrementer?, #first_sub_occurrence, #in_outer_cycle?, #next_cycle, #next_time, #outermost?, #short_name, #to_s, #update_cycle_range, #weeknum_incrementer?

Methods included from TimeManipulation

#advance_day, #advance_month, #advance_week, #advance_year, #first_day_of_month, #first_day_of_week, #first_day_of_year, #first_hour_of_day

Constructor Details

#initialize(rrule, parent) ⇒ WeeklyIncrementer

include WeeklyBydayMethods



599
600
601
602
# File 'lib/ri_cal/property_value/recurrence_rule/occurence_incrementer.rb', line 599

def initialize(rrule, parent)
  @wkst = rrule.wkst_day
  super(rrule, parent)
end

Instance Attribute Details

#wkstObject (readonly)

Returns the value of attribute wkst.



595
596
597
# File 'lib/ri_cal/property_value/recurrence_rule/occurence_incrementer.rb', line 595

def wkst
  @wkst
end

Class Method Details

.for_rrule(rrule) ⇒ Object



604
605
606
# File 'lib/ri_cal/property_value/recurrence_rule/occurence_incrementer.rb', line 604

def self.for_rrule(rrule)
  conditional_incrementer(rrule, "WEEKLY", ByDayIncrementer)
end

Instance Method Details

#advance_whatObject



612
613
614
# File 'lib/ri_cal/property_value/recurrence_rule/occurence_incrementer.rb', line 612

def advance_what
  :days
end

#end_of_occurrence(date_time) ⇒ Object



616
617
618
# File 'lib/ri_cal/property_value/recurrence_rule/occurence_incrementer.rb', line 616

def end_of_occurrence(date_time)
  date_time.end_of_week_with_wkst(wkst)
end

#multiplierObject



608
609
610
# File 'lib/ri_cal/property_value/recurrence_rule/occurence_incrementer.rb', line 608

def multiplier
  7
end