In Files

Class/Module Index [+]

Quicksearch

RiCal::PropertyValue::RecurrenceRule

RiCal::PropertyValue::RecurrenceRule represents an icalendar Recurrence Rule property value
which is defined in 
rfc 2445 section 4.3.10 pp 40-45

Attributes

count[R]

The integer count value of the receiver, or nil

until[R]

The DATE-TIME value of until limit of the receiver, or nil

Public Instance Methods

bounded?() click to toggle source

Predicate to determine if the receiver generates a bounded or infinite set of occurrences

# File lib/ri_cal/property_value/recurrence_rule.rb, line 149
def bounded?
  @count || @until
end
count=(count_value) click to toggle source

Set the count parameter of the recurrence rule, the count value will be converted to an integer using to_i

This method resets the receivers list of errors

# File lib/ri_cal/property_value/recurrence_rule.rb, line 97
def count=(count_value)
  reset_errors
  @count = count_value
  @until = nil unless @count.nil? || @by_list_hash
end
freq() click to toggle source

return the frequency of the rule which will be a string

# File lib/ri_cal/property_value/recurrence_rule.rb, line 68
def freq
  @freq.upcase
end
freq=(freq_value) click to toggle source

Set the frequency of the recurrence rule

freq_value

a String which should be in %w[SECONDLY MINUTELY HOURLY DAILY WEEKLY MONTHLY YEARLY]

This method resets the receivers list of errors

# File lib/ri_cal/property_value/recurrence_rule.rb, line 62
def freq=(freq_value)
  reset_errors
  @freq = freq_value
end
interval() click to toggle source

return the INTERVAL parameter of the recurrence rule This returns an Integer

# File lib/ri_cal/property_value/recurrence_rule.rb, line 116
def interval
  @interval ||= 1
end
interval=(interval_value) click to toggle source

Set the INTERVAL parameter of the recurrence rule

interval_value

an Integer

This method resets the receivers list of errors

# File lib/ri_cal/property_value/recurrence_rule.rb, line 125
def interval=(interval_value)
  reset_errors
  @interval = interval_value
end
to_ical() click to toggle source

Return a string containing the RFC 2445 representation of the recurrence rule

# File lib/ri_cal/property_value/recurrence_rule.rb, line 135
def to_ical
  result = ["FREQ=#{freq}"]
  result << "INTERVAL=#{interval}" unless interval == 1
  result << "COUNT=#{count}" if count
  result << "UNTIL=#{self.until.value}" if self.until
  %{bysecond byminute byhour byday bymonthday byyearday byweekno bymonth bysetpos}.each do |by_part|
    val = by_list[by_part.to_sym]
    result << "#{by_part.upcase}=#{[val].flatten.join(',')}" if val
  end
  result << "WKST=#{wkst}" unless wkst == "MO"
  result.join(";")
end
wkst() click to toggle source

return the starting week day for the recurrence rule, which for a valid instance will be one of “SU”, “MO”, “TU”, “WE”, “TH”, “FR”, or “SA”

# File lib/ri_cal/property_value/recurrence_rule.rb, line 74
def wkst
  @wkst || 'MO'
end
wkst=(value) click to toggle source

Set the starting week day for the recurrence rule, which should be one of “SU”, “MO”, “TU”, “WE”, “TH”, “FR”, or “SA” for the instance to be valid. The parameter is however case-insensitive.

This method resets the receivers list of errors

# File lib/ri_cal/property_value/recurrence_rule.rb, line 87
def wkst=(value)
  reset_errors
  @wkst = value
  @wkst_day = nil
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.