Sha256: ae1603e5afd228eacb70ea2a34e719400b087a5589983e5c323765c0f155e881

Contents?: true

Size: 1.07 KB

Versions: 11

Compression:

Stored size: 1.07 KB

Contents

module RiCal
  class PropertyValue
    class RecurrenceRule < PropertyValue
      #- ©2009 Rick DeNatale, All rights reserved. Refer to the file README.txt for the license
      #
      class OccurrenceIncrementer # :nodoc:
        class ByNumberedDayIncrementer < ListIncrementer #:nodoc:

          def daily_incrementer?
            true
          end
          
          def unneeded?(candidate)
            list.length == 1 && list.first.fixed_day?
          end

          def occurrences_for(date_time)
            if occurrences && @scoping_value == scope_of(date_time)
               occurrences
            else
              @scoping_value = scope_of(date_time)
              self.occurrences = list.map {|numbered_day| numbered_day.target_date_time_for(date_time)}.uniq.sort
              occurrences
            end
          end

          def end_of_occurrence(date_time)
            date_time.end_of_day
          end

          def candidate_acceptable?(candidate)
            list.any? {|by_part| by_part.include?(candidate)}
          end
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 6 rubygems

Version Path
demingfactor-ri_cal-0.10.0 lib/ri_cal/property_value/recurrence_rule/occurrence_incrementer/by_numbered_day_incrementer.rb
demingfactor-ri_cal-0.9.0 lib/ri_cal/property_value/recurrence_rule/occurrence_incrementer/by_numbered_day_incrementer.rb
awallis-ri_cal-0.8.8 lib/ri_cal/property_value/recurrence_rule/occurrence_incrementer/by_numbered_day_incrementer.rb
justinsoong-ri_cal-0.8.9 lib/ri_cal/property_value/recurrence_rule/occurrence_incrementer/by_numbered_day_incrementer.rb
justinsoong-ri_cal-0.8.8 lib/ri_cal/property_value/recurrence_rule/occurrence_incrementer/by_numbered_day_incrementer.rb
micahwedemeyer-ri_cal-0.8.10 lib/ri_cal/property_value/recurrence_rule/occurrence_incrementer/by_numbered_day_incrementer.rb
micahwedemeyer-ri_cal-0.8.9 lib/ri_cal/property_value/recurrence_rule/occurrence_incrementer/by_numbered_day_incrementer.rb
ri_cal-0.8.8 lib/ri_cal/property_value/recurrence_rule/occurrence_incrementer/by_numbered_day_incrementer.rb
ri_cal-0.8.7 lib/ri_cal/property_value/recurrence_rule/occurrence_incrementer/by_numbered_day_incrementer.rb
ri_cal-0.8.6 lib/ri_cal/property_value/recurrence_rule/occurrence_incrementer/by_numbered_day_incrementer.rb
miguelbaldi-ri_cal-0.1 lib/ri_cal/property_value/recurrence_rule/occurrence_incrementer/by_numbered_day_incrementer.rb