Sha256: 603eac4cd7f6ddf21659112fcc6f541f543cada3b4bde02f92da2a57ffe9b45b

Contents?: true

Size: 760 Bytes

Versions: 1

Compression:

Stored size: 760 Bytes

Contents

module RiCal
  class PropertyValue
    class RecurrenceRule < PropertyValue
      class OccurrenceIncrementer # :nodoc:
        class WeeklyIncrementer < FrequencyIncrementer #:nodoc:

          attr_reader :wkst

          # include WeeklyBydayMethods

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

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

          def multiplier
            7
          end

          def advance_what
            :days
          end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
friflaj_ri_cal-0.9.0 lib/ri_cal/property_value/recurrence_rule/occurrence_incrementer/weekly_incrementer.rb