ri_cal 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. data/History.txt +45 -0
  2. data/Manifest.txt +129 -0
  3. data/README.txt +394 -0
  4. data/Rakefile +31 -0
  5. data/bin/ri_cal +8 -0
  6. data/component_attributes/alarm.yml +10 -0
  7. data/component_attributes/calendar.yml +4 -0
  8. data/component_attributes/component_property_defs.yml +180 -0
  9. data/component_attributes/event.yml +45 -0
  10. data/component_attributes/freebusy.yml +16 -0
  11. data/component_attributes/journal.yml +35 -0
  12. data/component_attributes/timezone.yml +3 -0
  13. data/component_attributes/timezone_period.yml +11 -0
  14. data/component_attributes/todo.yml +46 -0
  15. data/copyrights.txt +1 -0
  16. data/docs/draft-ietf-calsify-2446bis-08.txt +7280 -0
  17. data/docs/draft-ietf-calsify-rfc2445bis-09.txt +10416 -0
  18. data/docs/incrementers.txt +7 -0
  19. data/docs/rfc2445.pdf +0 -0
  20. data/lib/ri_cal.rb +144 -0
  21. data/lib/ri_cal/component.rb +247 -0
  22. data/lib/ri_cal/component/alarm.rb +21 -0
  23. data/lib/ri_cal/component/calendar.rb +219 -0
  24. data/lib/ri_cal/component/event.rb +60 -0
  25. data/lib/ri_cal/component/freebusy.rb +18 -0
  26. data/lib/ri_cal/component/journal.rb +30 -0
  27. data/lib/ri_cal/component/t_z_info_timezone.rb +123 -0
  28. data/lib/ri_cal/component/timezone.rb +196 -0
  29. data/lib/ri_cal/component/timezone/daylight_period.rb +25 -0
  30. data/lib/ri_cal/component/timezone/standard_period.rb +23 -0
  31. data/lib/ri_cal/component/timezone/timezone_period.rb +53 -0
  32. data/lib/ri_cal/component/todo.rb +43 -0
  33. data/lib/ri_cal/core_extensions.rb +6 -0
  34. data/lib/ri_cal/core_extensions/array.rb +7 -0
  35. data/lib/ri_cal/core_extensions/array/conversions.rb +15 -0
  36. data/lib/ri_cal/core_extensions/date.rb +13 -0
  37. data/lib/ri_cal/core_extensions/date/conversions.rb +61 -0
  38. data/lib/ri_cal/core_extensions/date_time.rb +15 -0
  39. data/lib/ri_cal/core_extensions/date_time/conversions.rb +50 -0
  40. data/lib/ri_cal/core_extensions/object.rb +8 -0
  41. data/lib/ri_cal/core_extensions/object/conversions.rb +20 -0
  42. data/lib/ri_cal/core_extensions/string.rb +8 -0
  43. data/lib/ri_cal/core_extensions/string/conversions.rb +63 -0
  44. data/lib/ri_cal/core_extensions/time.rb +13 -0
  45. data/lib/ri_cal/core_extensions/time/calculations.rb +153 -0
  46. data/lib/ri_cal/core_extensions/time/conversions.rb +61 -0
  47. data/lib/ri_cal/core_extensions/time/tzid_access.rb +50 -0
  48. data/lib/ri_cal/core_extensions/time/week_day_predicates.rb +88 -0
  49. data/lib/ri_cal/floating_timezone.rb +32 -0
  50. data/lib/ri_cal/invalid_property_value.rb +8 -0
  51. data/lib/ri_cal/invalid_timezone_identifer.rb +20 -0
  52. data/lib/ri_cal/occurrence_enumerator.rb +206 -0
  53. data/lib/ri_cal/occurrence_period.rb +17 -0
  54. data/lib/ri_cal/parser.rb +138 -0
  55. data/lib/ri_cal/properties/alarm.rb +390 -0
  56. data/lib/ri_cal/properties/calendar.rb +164 -0
  57. data/lib/ri_cal/properties/event.rb +1526 -0
  58. data/lib/ri_cal/properties/freebusy.rb +594 -0
  59. data/lib/ri_cal/properties/journal.rb +1240 -0
  60. data/lib/ri_cal/properties/timezone.rb +151 -0
  61. data/lib/ri_cal/properties/timezone_period.rb +416 -0
  62. data/lib/ri_cal/properties/todo.rb +1562 -0
  63. data/lib/ri_cal/property_value.rb +149 -0
  64. data/lib/ri_cal/property_value/array.rb +27 -0
  65. data/lib/ri_cal/property_value/cal_address.rb +11 -0
  66. data/lib/ri_cal/property_value/date.rb +175 -0
  67. data/lib/ri_cal/property_value/date_time.rb +335 -0
  68. data/lib/ri_cal/property_value/date_time/additive_methods.rb +44 -0
  69. data/lib/ri_cal/property_value/date_time/time_machine.rb +181 -0
  70. data/lib/ri_cal/property_value/date_time/timezone_support.rb +96 -0
  71. data/lib/ri_cal/property_value/duration.rb +110 -0
  72. data/lib/ri_cal/property_value/geo.rb +11 -0
  73. data/lib/ri_cal/property_value/integer.rb +12 -0
  74. data/lib/ri_cal/property_value/occurrence_list.rb +144 -0
  75. data/lib/ri_cal/property_value/period.rb +82 -0
  76. data/lib/ri_cal/property_value/recurrence_rule.rb +145 -0
  77. data/lib/ri_cal/property_value/recurrence_rule/enumeration_support_methods.rb +97 -0
  78. data/lib/ri_cal/property_value/recurrence_rule/enumerator.rb +79 -0
  79. data/lib/ri_cal/property_value/recurrence_rule/initialization_methods.rb +148 -0
  80. data/lib/ri_cal/property_value/recurrence_rule/negative_setpos_enumerator.rb +53 -0
  81. data/lib/ri_cal/property_value/recurrence_rule/numbered_span.rb +31 -0
  82. data/lib/ri_cal/property_value/recurrence_rule/occurence_incrementer.rb +793 -0
  83. data/lib/ri_cal/property_value/recurrence_rule/recurring_day.rb +131 -0
  84. data/lib/ri_cal/property_value/recurrence_rule/recurring_month_day.rb +60 -0
  85. data/lib/ri_cal/property_value/recurrence_rule/recurring_numbered_week.rb +33 -0
  86. data/lib/ri_cal/property_value/recurrence_rule/recurring_year_day.rb +49 -0
  87. data/lib/ri_cal/property_value/recurrence_rule/validations.rb +125 -0
  88. data/lib/ri_cal/property_value/text.rb +40 -0
  89. data/lib/ri_cal/property_value/uri.rb +11 -0
  90. data/lib/ri_cal/property_value/utc_offset.rb +33 -0
  91. data/lib/ri_cal/required_timezones.rb +55 -0
  92. data/ri_cal.gemspec +49 -0
  93. data/sample_ical_files/from_ical_dot_app/test1.ics +38 -0
  94. data/script/console +10 -0
  95. data/script/destroy +14 -0
  96. data/script/generate +14 -0
  97. data/script/txt2html +71 -0
  98. data/spec/ri_cal/component/alarm_spec.rb +12 -0
  99. data/spec/ri_cal/component/calendar_spec.rb +54 -0
  100. data/spec/ri_cal/component/event_spec.rb +601 -0
  101. data/spec/ri_cal/component/freebusy_spec.rb +12 -0
  102. data/spec/ri_cal/component/journal_spec.rb +37 -0
  103. data/spec/ri_cal/component/t_z_info_timezone_spec.rb +36 -0
  104. data/spec/ri_cal/component/timezone_spec.rb +218 -0
  105. data/spec/ri_cal/component/todo_spec.rb +112 -0
  106. data/spec/ri_cal/component_spec.rb +224 -0
  107. data/spec/ri_cal/core_extensions/string/conversions_spec.rb +78 -0
  108. data/spec/ri_cal/core_extensions/time/calculations_spec.rb +188 -0
  109. data/spec/ri_cal/core_extensions/time/week_day_predicates_spec.rb +45 -0
  110. data/spec/ri_cal/occurrence_enumerator_spec.rb +573 -0
  111. data/spec/ri_cal/parser_spec.rb +303 -0
  112. data/spec/ri_cal/property_value/date_spec.rb +53 -0
  113. data/spec/ri_cal/property_value/date_time_spec.rb +383 -0
  114. data/spec/ri_cal/property_value/duration_spec.rb +126 -0
  115. data/spec/ri_cal/property_value/occurrence_list_spec.rb +72 -0
  116. data/spec/ri_cal/property_value/period_spec.rb +49 -0
  117. data/spec/ri_cal/property_value/recurrence_rule/recurring_year_day_spec.rb +21 -0
  118. data/spec/ri_cal/property_value/recurrence_rule_spec.rb +1814 -0
  119. data/spec/ri_cal/property_value/text_spec.rb +25 -0
  120. data/spec/ri_cal/property_value/utc_offset_spec.rb +48 -0
  121. data/spec/ri_cal/property_value_spec.rb +125 -0
  122. data/spec/ri_cal/required_timezones_spec.rb +67 -0
  123. data/spec/ri_cal_spec.rb +53 -0
  124. data/spec/spec.opts +4 -0
  125. data/spec/spec_helper.rb +46 -0
  126. data/tasks/gem_loader/load_active_support.rb +3 -0
  127. data/tasks/gem_loader/load_tzinfo_gem.rb +2 -0
  128. data/tasks/ri_cal.rake +410 -0
  129. data/tasks/spec.rake +50 -0
  130. metadata +221 -0
@@ -0,0 +1,594 @@
1
+ module RiCal
2
+ module Properties #:nodoc:
3
+ #- ©2009 Rick DeNatale
4
+ #- All rights reserved. Refer to the file README.txt for the license
5
+ #
6
+ # Properties::Freebusy provides property accessing methods for the Freebusy class
7
+ # This source file is generated by the rical:gen_propmodules rake tasks, DO NOT EDIT
8
+ module Freebusy
9
+
10
+ # return the the CONTACT property
11
+ # which will be an instances of RiCal::PropertyValueText
12
+ #
13
+ # [purpose (from RFC 2445)]
14
+ # The property is used to represent contact information oralternately a reference to contact information associated with the calendar component.
15
+ #
16
+ # see RFC 2445 4.8.4.2 pp 104-106
17
+ def contact_property
18
+ @contact_property
19
+ end
20
+
21
+ # set the CONTACT property
22
+ # property value should be an instance of RiCal::PropertyValueText
23
+ def contact_property=(property_value)
24
+ @contact_property = property_value
25
+ end
26
+
27
+ # set the value of the CONTACT property
28
+ def contact=(ruby_value)
29
+ self.contact_property= RiCal::PropertyValue::Text.convert(self, ruby_value)
30
+ end
31
+
32
+ # return the value of the CONTACT property
33
+ # which will be an instance of String
34
+ def contact
35
+ contact_property ? contact_property.ruby_value : nil
36
+ end
37
+
38
+ def contact_property_from_string(line) # :nodoc:
39
+ @contact_property = RiCal::PropertyValue::Text.new(self, line)
40
+ end
41
+
42
+
43
+ # return the the DTSTART property
44
+ # which will be an instances of either RiCal::PropertyValue::DateTime or RiCal::PropertyValue::Date
45
+ #
46
+ # [purpose (from RFC 2445)]
47
+ # This property specifies when the calendar component begins.
48
+ #
49
+ # see RFC 2445 4.8.2.4 pp 93-94
50
+ def dtstart_property
51
+ @dtstart_property
52
+ end
53
+
54
+ # set the DTSTART property
55
+ # property value should be an instance of either RiCal::PropertyValue::DateTime or RiCal::PropertyValue::Date
56
+ def dtstart_property=(property_value)
57
+ @dtstart_property = property_value ? property_value.for_parent(self) : nil
58
+ end
59
+
60
+ # set the value of the DTSTART property
61
+ def dtstart=(ruby_value)
62
+ self.dtstart_property= RiCal::PropertyValue::DateTime.convert(self, ruby_value)
63
+ end
64
+
65
+ # return the value of the DTSTART property
66
+ # which will be an instance of either DateTime or Date
67
+ def dtstart
68
+ dtstart_property ? dtstart_property.ruby_value : nil
69
+ end
70
+
71
+ def dtstart_property_from_string(line) # :nodoc:
72
+ @dtstart_property = RiCal::PropertyValue::DateTime.or_date(self, line)
73
+ end
74
+
75
+
76
+ # return the the DTEND property
77
+ # which will be an instances of either RiCal::PropertyValue::DateTime or RiCal::PropertyValue::Date
78
+ #
79
+ # [purpose (from RFC 2445)]
80
+ # This property specifies the date and time that a calendar component ends.
81
+ #
82
+ # see RFC 2445 4.8.2.2 pp 91-92
83
+ def dtend_property
84
+ @dtend_property
85
+ end
86
+
87
+ # set the DTEND property
88
+ # property value should be an instance of either RiCal::PropertyValue::DateTime or RiCal::PropertyValue::Date
89
+ def dtend_property=(property_value)
90
+ @dtend_property = property_value ? property_value.for_parent(self) : nil
91
+ end
92
+
93
+ # set the value of the DTEND property
94
+ def dtend=(ruby_value)
95
+ self.dtend_property= RiCal::PropertyValue::DateTime.convert(self, ruby_value)
96
+ end
97
+
98
+ # return the value of the DTEND property
99
+ # which will be an instance of either DateTime or Date
100
+ def dtend
101
+ dtend_property ? dtend_property.ruby_value : nil
102
+ end
103
+
104
+ def dtend_property_from_string(line) # :nodoc:
105
+ @dtend_property = RiCal::PropertyValue::DateTime.or_date(self, line)
106
+ end
107
+
108
+
109
+ # return the the DURATION property
110
+ # which will be an instances of RiCal::PropertyValueDuration
111
+ #
112
+ # [purpose (from RFC 2445)]
113
+ # This property specifies a positive duration of time.
114
+ #
115
+ # see RFC 2445 4.8.2.5 pp 94-95
116
+ def duration_property
117
+ @duration_property
118
+ end
119
+
120
+ # set the DURATION property
121
+ # property value should be an instance of RiCal::PropertyValueDuration
122
+ def duration_property=(property_value)
123
+ @duration_property = property_value
124
+ end
125
+
126
+ # set the value of the DURATION property
127
+ def duration=(ruby_value)
128
+ self.duration_property= RiCal::PropertyValue::Duration.convert(self, ruby_value)
129
+ end
130
+
131
+ # return the value of the DURATION property
132
+ # which will be an instance of Duration
133
+ def duration
134
+ duration_property ? duration_property.ruby_value : nil
135
+ end
136
+
137
+ def duration_property_from_string(line) # :nodoc:
138
+ @duration_property = RiCal::PropertyValue::Duration.new(self, line)
139
+ end
140
+
141
+
142
+ # return the the DTSTAMP property
143
+ # which will be an instances of RiCal::PropertyValueDateTime
144
+ #
145
+ # [purpose (from RFC 2445)]
146
+ # This property indicates the date/time that the instance of the iCalendar object was created.
147
+ #
148
+ # see RFC 2445 4.8.7.2 pp 130-131
149
+ def dtstamp_property
150
+ @dtstamp_property
151
+ end
152
+
153
+ # set the DTSTAMP property
154
+ # property value should be an instance of RiCal::PropertyValueDateTime
155
+ def dtstamp_property=(property_value)
156
+ @dtstamp_property = property_value ? property_value.for_parent(self) : nil
157
+ end
158
+
159
+ # set the value of the DTSTAMP property
160
+ def dtstamp=(ruby_value)
161
+ self.dtstamp_property= RiCal::PropertyValue::DateTime.convert(self, ruby_value)
162
+ end
163
+
164
+ # return the value of the DTSTAMP property
165
+ # which will be an instance of DateTime
166
+ def dtstamp
167
+ dtstamp_property ? dtstamp_property.ruby_value : nil
168
+ end
169
+
170
+ def dtstamp_property_from_string(line) # :nodoc:
171
+ @dtstamp_property = RiCal::PropertyValue::DateTime.new(self, line)
172
+ end
173
+
174
+
175
+ # return the the ORGANIZER property
176
+ # which will be an instances of RiCal::PropertyValueCalAddress
177
+ #
178
+ # [purpose (from RFC 2445)]
179
+ # The property defines the organizer for a calendar component.
180
+ #
181
+ # see RFC 2445 4.8.4.3 pp 106-107
182
+ def organizer_property
183
+ @organizer_property
184
+ end
185
+
186
+ # set the ORGANIZER property
187
+ # property value should be an instance of RiCal::PropertyValueCalAddress
188
+ def organizer_property=(property_value)
189
+ @organizer_property = property_value
190
+ end
191
+
192
+ # set the value of the ORGANIZER property
193
+ def organizer=(ruby_value)
194
+ self.organizer_property= RiCal::PropertyValue::CalAddress.convert(self, ruby_value)
195
+ end
196
+
197
+ # return the value of the ORGANIZER property
198
+ # which will be an instance of CalAddress
199
+ def organizer
200
+ organizer_property ? organizer_property.ruby_value : nil
201
+ end
202
+
203
+ def organizer_property_from_string(line) # :nodoc:
204
+ @organizer_property = RiCal::PropertyValue::CalAddress.new(self, line)
205
+ end
206
+
207
+
208
+ # return the the UID property
209
+ # which will be an instances of RiCal::PropertyValueText
210
+ #
211
+ # [purpose (from RFC 2445)]
212
+ # This property defines the persistent, globally unique identifier for the calendar component.
213
+ #
214
+ # see RFC 2445 4.8.4.7 pp 111-112
215
+ def uid_property
216
+ @uid_property
217
+ end
218
+
219
+ # set the UID property
220
+ # property value should be an instance of RiCal::PropertyValueText
221
+ def uid_property=(property_value)
222
+ @uid_property = property_value
223
+ end
224
+
225
+ # set the value of the UID property
226
+ def uid=(ruby_value)
227
+ self.uid_property= RiCal::PropertyValue::Text.convert(self, ruby_value)
228
+ end
229
+
230
+ # return the value of the UID property
231
+ # which will be an instance of String
232
+ def uid
233
+ uid_property ? uid_property.ruby_value : nil
234
+ end
235
+
236
+ def uid_property_from_string(line) # :nodoc:
237
+ @uid_property = RiCal::PropertyValue::Text.new(self, line)
238
+ end
239
+
240
+
241
+ # return the the URL property
242
+ # which will be an instances of RiCal::PropertyValueUri
243
+ #
244
+ # [purpose (from RFC 2445)]
245
+ # This property defines a Uniform Resource Locator (URL) associated with the iCalendar object.
246
+ #
247
+ # see RFC 2445 4.8.4.6 pp 110-111
248
+ def url_property
249
+ @url_property
250
+ end
251
+
252
+ # set the URL property
253
+ # property value should be an instance of RiCal::PropertyValueUri
254
+ def url_property=(property_value)
255
+ @url_property = property_value
256
+ end
257
+
258
+ # set the value of the URL property
259
+ def url=(ruby_value)
260
+ self.url_property= RiCal::PropertyValue::Uri.convert(self, ruby_value)
261
+ end
262
+
263
+ # return the value of the URL property
264
+ # which will be an instance of Uri
265
+ def url
266
+ url_property ? url_property.ruby_value : nil
267
+ end
268
+
269
+ def url_property_from_string(line) # :nodoc:
270
+ @url_property = RiCal::PropertyValue::Uri.new(self, line)
271
+ end
272
+
273
+
274
+ # return the the ATTENDEE property
275
+ # which will be an array of instances of RiCal::PropertyValueCalAddress
276
+ #
277
+ # [purpose (from RFC 2445)]
278
+ # The property defines an 'Attendee' within a calendar component.
279
+ #
280
+ # see RFC 2445 4.8.4.1 pp 102-104
281
+ def attendee_property
282
+ @attendee_property ||= []
283
+ end
284
+
285
+ # set the the ATTENDEE property
286
+ # one or more instances of RiCal::PropertyValueCalAddress may be passed to this method
287
+ def attendee_property=(*property_values)
288
+ @attendee_property= property_values
289
+ end
290
+
291
+ # set the value of the ATTENDEE property to multiple values
292
+ # one or more instances of CalAddress may be passed to this method
293
+ def attendees=(ruby_values)
294
+ @attendee_property = ruby_values.map {|val| RiCal::PropertyValue::CalAddress.convert(self, val)}
295
+ end
296
+
297
+ # set the value of the ATTENDEE property to a single value
298
+ # one instance of CalAddress may be passed to this method
299
+ def attendee=(ruby_value)
300
+ @attendee_property = [RiCal::PropertyValue::CalAddress.convert(self, ruby_value)]
301
+ end
302
+
303
+ # add one or more values to the ATTENDEE property
304
+ # one or more instances of CalAddress may be passed to this method
305
+ def add_attendees(*ruby_values)
306
+ ruby_values.each {|val| self.attendee_property << RiCal::PropertyValue::CalAddress.convert(self, val)}
307
+ end
308
+
309
+ # add one value to the ATTENDEE property
310
+ # one instances of CalAddress may be passed to this method
311
+ def add_attendee(ruby_value)
312
+ self.attendee_property << RiCal::PropertyValue::CalAddress.convert(self, ruby_value)
313
+ end
314
+
315
+ # remove one or more values from the ATTENDEE property
316
+ # one or more instances of CalAddress may be passed to this method
317
+ def remove_attendees(*ruby_values)
318
+ ruby_values.each {|val| self.attendee_property.delete(RiCal::PropertyValue::CalAddress.convert(self, val))}
319
+ end
320
+
321
+ # remove one value from the ATTENDEE property
322
+ # one instances of CalAddress may be passed to this method
323
+ def remove_attendee(ruby_value)
324
+ self.attendee_property.delete(RiCal::PropertyValue::CalAddress.convert(self, ruby_value))
325
+ end
326
+
327
+ # return the value of the ATTENDEE property
328
+ # which will be an array of instances of CalAddress
329
+ def attendee
330
+ attendee_property.map {|prop| prop ? prop.ruby_value : prop}
331
+ end
332
+
333
+ def attendee_property_from_string(line) # :nodoc:
334
+ attendee_property << RiCal::PropertyValue::CalAddress.new(self, line)
335
+ end
336
+
337
+ # return the the COMMENT property
338
+ # which will be an array of instances of RiCal::PropertyValueText
339
+ #
340
+ # [purpose (from RFC 2445)]
341
+ # This property specifies non-processing information intended to provide a comment to the calendar user.
342
+ #
343
+ # see RFC 2445 4.8.1.4 pp 80-81
344
+ def comment_property
345
+ @comment_property ||= []
346
+ end
347
+
348
+ # set the the COMMENT property
349
+ # one or more instances of RiCal::PropertyValueText may be passed to this method
350
+ def comment_property=(*property_values)
351
+ @comment_property= property_values
352
+ end
353
+
354
+ # set the value of the COMMENT property to multiple values
355
+ # one or more instances of String may be passed to this method
356
+ def comments=(ruby_values)
357
+ @comment_property = ruby_values.map {|val| RiCal::PropertyValue::Text.convert(self, val)}
358
+ end
359
+
360
+ # set the value of the COMMENT property to a single value
361
+ # one instance of String may be passed to this method
362
+ def comment=(ruby_value)
363
+ @comment_property = [RiCal::PropertyValue::Text.convert(self, ruby_value)]
364
+ end
365
+
366
+ # add one or more values to the COMMENT property
367
+ # one or more instances of String may be passed to this method
368
+ def add_comments(*ruby_values)
369
+ ruby_values.each {|val| self.comment_property << RiCal::PropertyValue::Text.convert(self, val)}
370
+ end
371
+
372
+ # add one value to the COMMENT property
373
+ # one instances of String may be passed to this method
374
+ def add_comment(ruby_value)
375
+ self.comment_property << RiCal::PropertyValue::Text.convert(self, ruby_value)
376
+ end
377
+
378
+ # remove one or more values from the COMMENT property
379
+ # one or more instances of String may be passed to this method
380
+ def remove_comments(*ruby_values)
381
+ ruby_values.each {|val| self.comment_property.delete(RiCal::PropertyValue::Text.convert(self, val))}
382
+ end
383
+
384
+ # remove one value from the COMMENT property
385
+ # one instances of String may be passed to this method
386
+ def remove_comment(ruby_value)
387
+ self.comment_property.delete(RiCal::PropertyValue::Text.convert(self, ruby_value))
388
+ end
389
+
390
+ # return the value of the COMMENT property
391
+ # which will be an array of instances of String
392
+ def comment
393
+ comment_property.map {|prop| prop ? prop.ruby_value : prop}
394
+ end
395
+
396
+ def comment_property_from_string(line) # :nodoc:
397
+ comment_property << RiCal::PropertyValue::Text.new(self, line)
398
+ end
399
+
400
+ # return the the FREEBUSY property
401
+ # which will be an array of instances of RiCal::PropertyValuePeriod
402
+ #
403
+ # [purpose (from RFC 2445)]
404
+ # This property defines one or more free or busy time intervals.
405
+ #
406
+ # see RFC 2445 4.8.2.6 pp 95-96
407
+ def freebusy_property
408
+ @freebusy_property ||= []
409
+ end
410
+
411
+ # set the the FREEBUSY property
412
+ # one or more instances of RiCal::PropertyValuePeriod may be passed to this method
413
+ def freebusy_property=(*property_values)
414
+ @freebusy_property= property_values
415
+ end
416
+
417
+ # set the value of the FREEBUSY property to multiple values
418
+ # one or more instances of Period may be passed to this method
419
+ def freebusys=(ruby_values)
420
+ @freebusy_property = ruby_values.map {|val| RiCal::PropertyValue::Period.convert(self, val)}
421
+ end
422
+
423
+ # set the value of the FREEBUSY property to a single value
424
+ # one instance of Period may be passed to this method
425
+ def freebusy=(ruby_value)
426
+ @freebusy_property = [RiCal::PropertyValue::Period.convert(self, ruby_value)]
427
+ end
428
+
429
+ # add one or more values to the FREEBUSY property
430
+ # one or more instances of Period may be passed to this method
431
+ def add_freebusys(*ruby_values)
432
+ ruby_values.each {|val| self.freebusy_property << RiCal::PropertyValue::Period.convert(self, val)}
433
+ end
434
+
435
+ # add one value to the FREEBUSY property
436
+ # one instances of Period may be passed to this method
437
+ def add_freebusy(ruby_value)
438
+ self.freebusy_property << RiCal::PropertyValue::Period.convert(self, ruby_value)
439
+ end
440
+
441
+ # remove one or more values from the FREEBUSY property
442
+ # one or more instances of Period may be passed to this method
443
+ def remove_freebusys(*ruby_values)
444
+ ruby_values.each {|val| self.freebusy_property.delete(RiCal::PropertyValue::Period.convert(self, val))}
445
+ end
446
+
447
+ # remove one value from the FREEBUSY property
448
+ # one instances of Period may be passed to this method
449
+ def remove_freebusy(ruby_value)
450
+ self.freebusy_property.delete(RiCal::PropertyValue::Period.convert(self, ruby_value))
451
+ end
452
+
453
+ # return the value of the FREEBUSY property
454
+ # which will be an array of instances of Period
455
+ def freebusy
456
+ freebusy_property.map {|prop| prop ? prop.ruby_value : prop}
457
+ end
458
+
459
+ def freebusy_property_from_string(line) # :nodoc:
460
+ freebusy_property << RiCal::PropertyValue::Period.new(self, line)
461
+ end
462
+
463
+ # return the the REQUEST-STATUS property
464
+ # which will be an array of instances of RiCal::PropertyValueText
465
+ #
466
+ # see RFC 2445 4.8.8.2 pp 134-136
467
+ def request_status_property
468
+ @request_status_property ||= []
469
+ end
470
+
471
+ # set the the REQUEST-STATUS property
472
+ # one or more instances of RiCal::PropertyValueText may be passed to this method
473
+ def request_status_property=(*property_values)
474
+ @request_status_property= property_values
475
+ end
476
+
477
+ # set the value of the REQUEST-STATUS property to multiple values
478
+ # one or more instances of String may be passed to this method
479
+ def request_statuses=(ruby_values)
480
+ @request_status_property = ruby_values.map {|val| RiCal::PropertyValue::Text.convert(self, val)}
481
+ end
482
+
483
+ # set the value of the REQUEST-STATUS property to a single value
484
+ # one instance of String may be passed to this method
485
+ def request_status=(ruby_value)
486
+ @request_status_property = [RiCal::PropertyValue::Text.convert(self, ruby_value)]
487
+ end
488
+
489
+ # add one or more values to the REQUEST-STATUS property
490
+ # one or more instances of String may be passed to this method
491
+ def add_request_statuses(*ruby_values)
492
+ ruby_values.each {|val| self.request_status_property << RiCal::PropertyValue::Text.convert(self, val)}
493
+ end
494
+
495
+ # add one value to the REQUEST-STATUS property
496
+ # one instances of String may be passed to this method
497
+ def add_request_status(ruby_value)
498
+ self.request_status_property << RiCal::PropertyValue::Text.convert(self, ruby_value)
499
+ end
500
+
501
+ # remove one or more values from the REQUEST-STATUS property
502
+ # one or more instances of String may be passed to this method
503
+ def remove_request_statuses(*ruby_values)
504
+ ruby_values.each {|val| self.request_status_property.delete(RiCal::PropertyValue::Text.convert(self, val))}
505
+ end
506
+
507
+ # remove one value from the REQUEST-STATUS property
508
+ # one instances of String may be passed to this method
509
+ def remove_request_status(ruby_value)
510
+ self.request_status_property.delete(RiCal::PropertyValue::Text.convert(self, ruby_value))
511
+ end
512
+
513
+ # return the value of the REQUEST-STATUS property
514
+ # which will be an array of instances of String
515
+ def request_status
516
+ request_status_property.map {|prop| prop ? prop.ruby_value : prop}
517
+ end
518
+
519
+ def request_status_property_from_string(line) # :nodoc:
520
+ request_status_property << RiCal::PropertyValue::Text.new(self, line)
521
+ end
522
+
523
+ def export_properties_to(export_stream) #:nodoc:
524
+ export_prop_to(export_stream, "REQUEST-STATUS", @request_status_property)
525
+ export_prop_to(export_stream, "DTSTAMP", @dtstamp_property)
526
+ export_prop_to(export_stream, "DTEND", @dtend_property)
527
+ export_prop_to(export_stream, "DTSTART", @dtstart_property)
528
+ export_prop_to(export_stream, "CONTACT", @contact_property)
529
+ export_prop_to(export_stream, "ATTENDEE", @attendee_property)
530
+ export_prop_to(export_stream, "UID", @uid_property)
531
+ export_prop_to(export_stream, "DURATION", @duration_property)
532
+ export_prop_to(export_stream, "URL", @url_property)
533
+ export_prop_to(export_stream, "ORGANIZER", @organizer_property)
534
+ export_prop_to(export_stream, "FREEBUSY", @freebusy_property)
535
+ export_prop_to(export_stream, "COMMENT", @comment_property)
536
+ end
537
+
538
+ def ==(o) #:nodoc:
539
+ if o.class == self.class
540
+ (request_status_property == o.request_status_property) &&
541
+ (dtstamp_property == o.dtstamp_property) &&
542
+ (dtend_property == o.dtend_property) &&
543
+ (dtstart_property == o.dtstart_property) &&
544
+ (contact_property == o.contact_property) &&
545
+ (attendee_property == o.attendee_property) &&
546
+ (uid_property == o.uid_property) &&
547
+ (duration_property == o.duration_property) &&
548
+ (url_property == o.url_property) &&
549
+ (organizer_property == o.organizer_property) &&
550
+ (freebusy_property == o.freebusy_property) &&
551
+ (comment_property == o.comment_property)
552
+ else
553
+ super
554
+ end
555
+ end
556
+
557
+ def initialize_copy(o) #:nodoc:
558
+ super
559
+ request_status_property = request_status_property && request_status_property.dup
560
+ dtstamp_property = dtstamp_property && dtstamp_property.dup
561
+ dtend_property = dtend_property && dtend_property.dup
562
+ dtstart_property = dtstart_property && dtstart_property.dup
563
+ contact_property = contact_property && contact_property.dup
564
+ attendee_property = attendee_property && attendee_property.dup
565
+ uid_property = uid_property && uid_property.dup
566
+ duration_property = duration_property && duration_property.dup
567
+ url_property = url_property && url_property.dup
568
+ organizer_property = organizer_property && organizer_property.dup
569
+ freebusy_property = freebusy_property && freebusy_property.dup
570
+ comment_property = comment_property && comment_property.dup
571
+ end
572
+
573
+ def add_date_times_to(required_timezones) #:nodoc:
574
+ add_property_date_times_to(required_timezones, dtstart_property)
575
+ add_property_date_times_to(required_timezones, dtend_property)
576
+ add_property_date_times_to(required_timezones, dtstamp_property)
577
+ end
578
+
579
+ module ClassMethods #:nodoc:
580
+ def property_parser #:nodoc:
581
+ {"DTEND"=>:dtend_property_from_string, "DTSTART"=>:dtstart_property_from_string, "DTSTAMP"=>:dtstamp_property_from_string, "URL"=>:url_property_from_string, "CONTACT"=>:contact_property_from_string, "UID"=>:uid_property_from_string, "ATTENDEE"=>:attendee_property_from_string, "ORGANIZER"=>:organizer_property_from_string, "REQUEST-STATUS"=>:request_status_property_from_string, "FREEBUSY"=>:freebusy_property_from_string, "COMMENT"=>:comment_property_from_string, "DURATION"=>:duration_property_from_string}
582
+ end
583
+ end
584
+
585
+ def self.included(mod) #:nodoc:
586
+ mod.extend ClassMethods
587
+ end
588
+
589
+ def mutual_exclusion_violation #:nodoc:
590
+ false
591
+ end
592
+ end
593
+ end
594
+ end