Class: RiCal::PropertyValue::RecurrenceRule::MonthlyIncrementer

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

Overview

:nodoc:

Instance Attribute Summary

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, #initialize, #multiplier, #next_cycle

Methods inherited from OccurrenceIncrementer

#add_outer_incrementer, #contains_daily_incrementer?, #contains_weeknum_incrementer?, #daily_incrementer?, #first_sub_occurrence, #in_outer_cycle?, #initialize, #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

This class inherits a constructor from RiCal::PropertyValue::RecurrenceRule::FrequencyIncrementer

Class Method Details

.for_rrule(rrule) ⇒ Object



679
680
681
# File 'lib/ri_cal/property_value/recurrence_rule/occurence_incrementer.rb', line 679

def self.for_rrule(rrule)
  conditional_incrementer(rrule, "MONTHLY", ByWeekNoIncrementer)
end

Instance Method Details

#advance_whatObject



683
684
685
# File 'lib/ri_cal/property_value/recurrence_rule/occurence_incrementer.rb', line 683

def advance_what
  :months
end

#end_of_occurrence(date_time) ⇒ Object



696
697
698
# File 'lib/ri_cal/property_value/recurrence_rule/occurence_incrementer.rb', line 696

def end_of_occurrence(date_time)
  date_time.end_of_month
end

#step(date_time) ⇒ Object



687
688
689
690
691
692
693
694
# File 'lib/ri_cal/property_value/recurrence_rule/occurence_incrementer.rb', line 687

def step(date_time)
  if contains_daily_incrementer?
    result = super(date_time).change(:day => 1)
    result
  else
    super(date_time)
  end
end