def initialize(name, params, value, parser)
frequency_match = value.match(/FREQ=(SECONDLY|MINUTELY|HOURLY|DAILY|WEEKLY|MONTHLY|YEARLY)/)
raise Icalendar::InvalidPropertyValue.new("FREQ must be specified for RRULE values") unless frequency_match
@frequency = frequency_match[1]
@until = parse_date_val("UNTIL", value)
@count = parse_int_val("COUNT", value)
raise Icalendar::InvalidPropertyValue.new("UNTIL and COUNT must not both be specified for RRULE values") if [@until, @count].compact.length > 1
@interval = parse_int_val("INTERVAL", value)
@by_list = {:bysecond => parse_int_list("BYSECOND", value)}
@by_list[:byminute] = parse_int_list("BYMINUTE",value)
@by_list[:byhour] = parse_int_list("BYHOUR", value)
@by_list[:byday] = parse_weekday_list("BYDAY", value)
@by_list[:bymonthday] = parse_int_list("BYMONTHDAY", value)
@by_list[:byyearday] = parse_int_list("BYYEARDAY", value)
@by_list[:byweekno] = parse_int_list("BYWEEKNO", value)
@by_list[:bymonth] = parse_int_list("BYMONTH", value)
@by_list[:bysetpos] = parse_int_list("BYSETPOS", value)
@wkst = parse_wkstart(value)
end