module Vpim::Icalendar::Property::Recurrence
Occurrences are calculated from DTSTART and RRULE. If there is no RRULE, the component occurs only once, at the start time.
Limitations:
Only a single RRULE: is currently supported, this is the most common case.
Public Instance Methods
occurrences(dountil = nil) { |occurrence time| ... }
click to toggle source
The times this components occurs. If a block is not provided, returns an enumerator.
Occurrences may be infinite, dountil
can be provided to limit
the iterations, see Vpim::Rrule#each.
# File lib/vpim/property/recurrence.rb, line 36 def occurrences(dountil = nil, &block) #:yield: occurrence time rr = rrule unless block_given? return Enumerable::Enumerator.new(self, :occurrences, dountil) end rr.each(dountil, &block) end
Also aliased as: occurences
occurs_in?(t0, t1)
click to toggle source
True if this components occurs in a time period later than t0
,
but earlier than t1
.
# File lib/vpim/property/recurrence.rb, line 49 def occurs_in?(t0, t1) # TODO - deprecate this, its a hack occurrences(t1).detect do |tend| if respond_to? :duration tend += duration || 0 end tend >= t0 end end