rubyredrick-ri_cal 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. data/History.txt +3 -0
  2. data/Manifest.txt +122 -0
  3. data/README.txt +271 -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 +2 -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/component/alarm.rb +22 -0
  21. data/lib/ri_cal/component/calendar.rb +199 -0
  22. data/lib/ri_cal/component/event.rb +30 -0
  23. data/lib/ri_cal/component/freebusy.rb +19 -0
  24. data/lib/ri_cal/component/journal.rb +22 -0
  25. data/lib/ri_cal/component/t_z_info_timezone.rb +124 -0
  26. data/lib/ri_cal/component/timezone/daylight_period.rb +26 -0
  27. data/lib/ri_cal/component/timezone/standard_period.rb +24 -0
  28. data/lib/ri_cal/component/timezone/timezone_period.rb +54 -0
  29. data/lib/ri_cal/component/timezone.rb +193 -0
  30. data/lib/ri_cal/component/todo.rb +26 -0
  31. data/lib/ri_cal/component.rb +224 -0
  32. data/lib/ri_cal/core_extensions/array/conversions.rb +15 -0
  33. data/lib/ri_cal/core_extensions/array.rb +7 -0
  34. data/lib/ri_cal/core_extensions/date/conversions.rb +27 -0
  35. data/lib/ri_cal/core_extensions/date.rb +13 -0
  36. data/lib/ri_cal/core_extensions/date_time/conversions.rb +27 -0
  37. data/lib/ri_cal/core_extensions/date_time.rb +13 -0
  38. data/lib/ri_cal/core_extensions/object/conversions.rb +20 -0
  39. data/lib/ri_cal/core_extensions/object.rb +8 -0
  40. data/lib/ri_cal/core_extensions/string/conversions.rb +32 -0
  41. data/lib/ri_cal/core_extensions/string.rb +8 -0
  42. data/lib/ri_cal/core_extensions/time/calculations.rb +153 -0
  43. data/lib/ri_cal/core_extensions/time/conversions.rb +27 -0
  44. data/lib/ri_cal/core_extensions/time/week_day_predicates.rb +88 -0
  45. data/lib/ri_cal/core_extensions/time.rb +11 -0
  46. data/lib/ri_cal/core_extensions.rb +6 -0
  47. data/lib/ri_cal/invalid_timezone_identifer.rb +20 -0
  48. data/lib/ri_cal/occurrence_enumerator.rb +172 -0
  49. data/lib/ri_cal/parser.rb +138 -0
  50. data/lib/ri_cal/properties/alarm.rb +390 -0
  51. data/lib/ri_cal/properties/calendar.rb +164 -0
  52. data/lib/ri_cal/properties/event.rb +1526 -0
  53. data/lib/ri_cal/properties/freebusy.rb +594 -0
  54. data/lib/ri_cal/properties/journal.rb +1240 -0
  55. data/lib/ri_cal/properties/timezone.rb +151 -0
  56. data/lib/ri_cal/properties/timezone_period.rb +416 -0
  57. data/lib/ri_cal/properties/todo.rb +1562 -0
  58. data/lib/ri_cal/property_value/array.rb +19 -0
  59. data/lib/ri_cal/property_value/cal_address.rb +12 -0
  60. data/lib/ri_cal/property_value/date.rb +119 -0
  61. data/lib/ri_cal/property_value/date_time/additive_methods.rb +43 -0
  62. data/lib/ri_cal/property_value/date_time/time_machine.rb +180 -0
  63. data/lib/ri_cal/property_value/date_time/timezone_support.rb +65 -0
  64. data/lib/ri_cal/property_value/date_time.rb +324 -0
  65. data/lib/ri_cal/property_value/duration.rb +106 -0
  66. data/lib/ri_cal/property_value/geo.rb +12 -0
  67. data/lib/ri_cal/property_value/integer.rb +13 -0
  68. data/lib/ri_cal/property_value/occurrence_list.rb +82 -0
  69. data/lib/ri_cal/property_value/period.rb +63 -0
  70. data/lib/ri_cal/property_value/recurrence_rule/enumeration_support_methods.rb +98 -0
  71. data/lib/ri_cal/property_value/recurrence_rule/enumerator.rb +77 -0
  72. data/lib/ri_cal/property_value/recurrence_rule/initialization_methods.rb +149 -0
  73. data/lib/ri_cal/property_value/recurrence_rule/negative_setpos_enumerator.rb +54 -0
  74. data/lib/ri_cal/property_value/recurrence_rule/numbered_span.rb +32 -0
  75. data/lib/ri_cal/property_value/recurrence_rule/occurence_incrementer.rb +794 -0
  76. data/lib/ri_cal/property_value/recurrence_rule/recurring_day.rb +132 -0
  77. data/lib/ri_cal/property_value/recurrence_rule/recurring_month_day.rb +61 -0
  78. data/lib/ri_cal/property_value/recurrence_rule/recurring_numbered_week.rb +34 -0
  79. data/lib/ri_cal/property_value/recurrence_rule/recurring_year_day.rb +50 -0
  80. data/lib/ri_cal/property_value/recurrence_rule/validations.rb +126 -0
  81. data/lib/ri_cal/property_value/recurrence_rule.rb +146 -0
  82. data/lib/ri_cal/property_value/text.rb +41 -0
  83. data/lib/ri_cal/property_value/uri.rb +12 -0
  84. data/lib/ri_cal/property_value/utc_offset.rb +34 -0
  85. data/lib/ri_cal/property_value.rb +110 -0
  86. data/lib/ri_cal/required_timezones.rb +56 -0
  87. data/lib/ri_cal/time_with_floating_timezone.rb +59 -0
  88. data/lib/ri_cal.rb +134 -0
  89. data/ri_cal.gemspec +47 -0
  90. data/sample_ical_files/from_ical_dot_app/test1.ics +38 -0
  91. data/script/console +10 -0
  92. data/script/destroy +14 -0
  93. data/script/generate +14 -0
  94. data/script/txt2html +71 -0
  95. data/spec/ri_cal/component/alarm_spec.rb +13 -0
  96. data/spec/ri_cal/component/calendar_spec.rb +55 -0
  97. data/spec/ri_cal/component/event_spec.rb +157 -0
  98. data/spec/ri_cal/component/freebusy_spec.rb +13 -0
  99. data/spec/ri_cal/component/journal_spec.rb +13 -0
  100. data/spec/ri_cal/component/t_z_info_timezone_spec.rb +37 -0
  101. data/spec/ri_cal/component/timezone_spec.rb +155 -0
  102. data/spec/ri_cal/component/todo_spec.rb +61 -0
  103. data/spec/ri_cal/component_spec.rb +212 -0
  104. data/spec/ri_cal/core_extensions/time/calculations_spec.rb +189 -0
  105. data/spec/ri_cal/core_extensions/time/week_day_predicates_spec.rb +46 -0
  106. data/spec/ri_cal/occurrence_enumerator_spec.rb +218 -0
  107. data/spec/ri_cal/parser_spec.rb +304 -0
  108. data/spec/ri_cal/property_value/date_spec.rb +22 -0
  109. data/spec/ri_cal/property_value/date_time_spec.rb +448 -0
  110. data/spec/ri_cal/property_value/duration_spec.rb +80 -0
  111. data/spec/ri_cal/property_value/period_spec.rb +50 -0
  112. data/spec/ri_cal/property_value/recurrence_rule/recurring_year_day_spec.rb +22 -0
  113. data/spec/ri_cal/property_value/recurrence_rule_spec.rb +1815 -0
  114. data/spec/ri_cal/property_value/text_spec.rb +14 -0
  115. data/spec/ri_cal/property_value/utc_offset_spec.rb +49 -0
  116. data/spec/ri_cal/property_value_spec.rb +111 -0
  117. data/spec/ri_cal/required_timezones_spec.rb +68 -0
  118. data/spec/ri_cal_spec.rb +54 -0
  119. data/spec/spec.opts +4 -0
  120. data/spec/spec_helper.rb +24 -0
  121. data/tasks/ri_cal.rake +403 -0
  122. data/tasks/spec.rake +35 -0
  123. metadata +201 -0
@@ -0,0 +1,390 @@
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::Alarm provides property accessing methods for the Alarm class
7
+ # This source file is generated by the rical:gen_propmodules rake tasks, DO NOT EDIT
8
+ module Alarm
9
+
10
+ # return the the ACTION property
11
+ # which will be an instances of RiCal::PropertyValueText
12
+ #
13
+ # [purpose (from RFC 2445)]
14
+ # This property defines the action to be invoked when an alarm is triggered
15
+ #
16
+ # see RFC 2445 4.8.6.1 p 126
17
+ def action_property
18
+ @action_property
19
+ end
20
+
21
+ # set the ACTION property
22
+ # property value should be an instance of RiCal::PropertyValueText
23
+ def action_property=(property_value)
24
+ @action_property = property_value
25
+ end
26
+
27
+ # set the value of the ACTION property
28
+ def action=(ruby_value)
29
+ self.action_property= RiCal::PropertyValue::Text.convert(self, ruby_value)
30
+ end
31
+
32
+ # return the value of the ACTION property
33
+ # which will be an instance of String
34
+ def action
35
+ action_property ? action_property.ruby_value : nil
36
+ end
37
+
38
+ def action_property_from_string(line) # :nodoc:
39
+ @action_property = RiCal::PropertyValue::Text.new(self, line)
40
+ end
41
+
42
+
43
+ # return the the DESCRIPTION property
44
+ # which will be an instances of RiCal::PropertyValueText
45
+ #
46
+ # [purpose (from RFC 2445)]
47
+ # This property provides a more complete description of the calendar component, than that provided by the "SUMMARY" property.
48
+ #
49
+ # see RFC 2445 4.8.1.5 pp 81-82
50
+ def description_property
51
+ @description_property
52
+ end
53
+
54
+ # set the DESCRIPTION property
55
+ # property value should be an instance of RiCal::PropertyValueText
56
+ def description_property=(property_value)
57
+ @description_property = property_value
58
+ end
59
+
60
+ # set the value of the DESCRIPTION property
61
+ def description=(ruby_value)
62
+ self.description_property= RiCal::PropertyValue::Text.convert(self, ruby_value)
63
+ end
64
+
65
+ # return the value of the DESCRIPTION property
66
+ # which will be an instance of String
67
+ def description
68
+ description_property ? description_property.ruby_value : nil
69
+ end
70
+
71
+ def description_property_from_string(line) # :nodoc:
72
+ @description_property = RiCal::PropertyValue::Text.new(self, line)
73
+ end
74
+
75
+
76
+ # return the the TRIGGER property
77
+ # which will be an instances of RiCal::PropertyValueduration_or_utc_date_time
78
+ #
79
+ # [purpose (from RFC 2445)]
80
+ # This property specifies when an alarm will trigger.
81
+ #
82
+ # see RFC 2445 4.8.6.3 p 127-129
83
+ def trigger_property
84
+ @trigger_property
85
+ end
86
+
87
+ # set the TRIGGER property
88
+ # property value should be an instance of RiCal::PropertyValueduration_or_utc_date_time
89
+ def trigger_property=(property_value)
90
+ @trigger_property = property_value
91
+ end
92
+
93
+ # set the value of the TRIGGER property
94
+ def trigger=(ruby_value)
95
+ self.trigger_property= RiCal::PropertyValue::duration_or_utc_date_time.convert(self, ruby_value)
96
+ end
97
+
98
+ # return the value of the TRIGGER property
99
+ # which will be an instance of duration_or_utc_date_time
100
+ def trigger
101
+ trigger_property ? trigger_property.ruby_value : nil
102
+ end
103
+
104
+ def trigger_property_from_string(line) # :nodoc:
105
+ @trigger_property = RiCal::PropertyValue::duration_or_utc_date_time.new(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 REPEAT property
143
+ # which will be an instances of RiCal::PropertyValueInteger
144
+ #
145
+ # [purpose (from RFC 2445)]
146
+ # This property defines the number of times the alarm should be repeated, after the initial trigger.
147
+ #
148
+ # see RFC 2445 4.8.6.2 p 126-127
149
+ def repeat_property
150
+ @repeat_property
151
+ end
152
+
153
+ # set the REPEAT property
154
+ # property value should be an instance of RiCal::PropertyValueInteger
155
+ def repeat_property=(property_value)
156
+ @repeat_property = property_value
157
+ end
158
+
159
+ # set the value of the REPEAT property
160
+ def repeat=(ruby_value)
161
+ self.repeat_property= RiCal::PropertyValue::Integer.convert(self, ruby_value)
162
+ end
163
+
164
+ # return the value of the REPEAT property
165
+ # which will be an instance of Integer
166
+ def repeat
167
+ repeat_property ? repeat_property.ruby_value : nil
168
+ end
169
+
170
+ def repeat_property_from_string(line) # :nodoc:
171
+ @repeat_property = RiCal::PropertyValue::Integer.new(self, line)
172
+ end
173
+
174
+
175
+ # return the the SUMMARY property
176
+ # which will be an instances of RiCal::PropertyValueText
177
+ #
178
+ # [purpose (from RFC 2445)]
179
+ # This property defines a short summary or subject for the calendar component.
180
+ #
181
+ # see RFC 2445 4.8.1.12 pp 89-90
182
+ def summary_property
183
+ @summary_property
184
+ end
185
+
186
+ # set the SUMMARY property
187
+ # property value should be an instance of RiCal::PropertyValueText
188
+ def summary_property=(property_value)
189
+ @summary_property = property_value
190
+ end
191
+
192
+ # set the value of the SUMMARY property
193
+ def summary=(ruby_value)
194
+ self.summary_property= RiCal::PropertyValue::Text.convert(self, ruby_value)
195
+ end
196
+
197
+ # return the value of the SUMMARY property
198
+ # which will be an instance of String
199
+ def summary
200
+ summary_property ? summary_property.ruby_value : nil
201
+ end
202
+
203
+ def summary_property_from_string(line) # :nodoc:
204
+ @summary_property = RiCal::PropertyValue::Text.new(self, line)
205
+ end
206
+
207
+
208
+ # return the the ATTENDEE property
209
+ # which will be an array of instances of RiCal::PropertyValueCalAddress
210
+ #
211
+ # [purpose (from RFC 2445)]
212
+ # The property defines an 'Attendee' within a calendar component.
213
+ #
214
+ # see RFC 2445 4.8.4.1 pp 102-104
215
+ def attendee_property
216
+ @attendee_property ||= []
217
+ end
218
+
219
+ # set the the ATTENDEE property
220
+ # one or more instances of RiCal::PropertyValueCalAddress may be passed to this method
221
+ def attendee_property=(*property_values)
222
+ @attendee_property= property_values
223
+ end
224
+
225
+ # set the value of the ATTENDEE property to multiple values
226
+ # one or more instances of CalAddress may be passed to this method
227
+ def attendees=(*ruby_values)
228
+ @attendee_property = ruby_values.map {|val| RiCal::PropertyValue::CalAddress.convert(self, val)}
229
+ end
230
+
231
+ # set the value of the ATTENDEE property to a single value
232
+ # one instance of CalAddress may be passed to this method
233
+ def attendee=(ruby_value)
234
+ @attendee_property = [RiCal::PropertyValue::CalAddress.convert(self, ruby_value)]
235
+ end
236
+
237
+ # add one or more values to the ATTENDEE property
238
+ # one or more instances of CalAddress may be passed to this method
239
+ def add_attendees(*ruby_values)
240
+ ruby_values.do {|val| self.attendee_property << RiCal::PropertyValue::CalAddress.convert(self, val)}
241
+ end
242
+
243
+ # add one value to the ATTENDEE property
244
+ # one instances of CalAddress may be passed to this method
245
+ def add_attendee(ruby_value)
246
+ self.attendee_property << RiCal::PropertyValue::CalAddress.convert(self, ruby_value)
247
+ end
248
+
249
+ # remove one or more values from the ATTENDEE property
250
+ # one or more instances of CalAddress may be passed to this method
251
+ def remove_attendees(*ruby_values)
252
+ ruby_values.do {|val| self.attendee_property.delete(RiCal::PropertyValue::CalAddress.convert(self, val))}
253
+ end
254
+
255
+ # remove one value from the ATTENDEE property
256
+ # one instances of CalAddress may be passed to this method
257
+ def remove_attendee(ruby_value)
258
+ self.attendee_property.delete(RiCal::PropertyValue::CalAddress.convert(self, ruby_value))
259
+ end
260
+
261
+ # return the value of the ATTENDEE property
262
+ # which will be an array of instances of CalAddress
263
+ def attendee
264
+ attendee_property.map {|prop| prop ? prop.value : prop}
265
+ end
266
+
267
+ def attendee_property_from_string(line) # :nodoc:
268
+ attendee_property << RiCal::PropertyValue::CalAddress.new(self, line)
269
+ end
270
+
271
+ # return the the ATTACH property
272
+ # which will be an array of instances of RiCal::PropertyValueUri
273
+ #
274
+ # [purpose (from RFC 2445)]
275
+ # The property provides the capability to associate a document object with a calendar component.
276
+ #
277
+ # see RFC 2445 4.8.1.1 pp 77-78
278
+ def attach_property
279
+ @attach_property ||= []
280
+ end
281
+
282
+ # set the the ATTACH property
283
+ # one or more instances of RiCal::PropertyValueUri may be passed to this method
284
+ def attach_property=(*property_values)
285
+ @attach_property= property_values
286
+ end
287
+
288
+ # set the value of the ATTACH property to multiple values
289
+ # one or more instances of Uri may be passed to this method
290
+ def attachments=(*ruby_values)
291
+ @attach_property = ruby_values.map {|val| RiCal::PropertyValue::Uri.convert(self, val)}
292
+ end
293
+
294
+ # set the value of the ATTACH property to a single value
295
+ # one instance of Uri may be passed to this method
296
+ def attach=(ruby_value)
297
+ @attach_property = [RiCal::PropertyValue::Uri.convert(self, ruby_value)]
298
+ end
299
+
300
+ # add one or more values to the ATTACH property
301
+ # one or more instances of Uri may be passed to this method
302
+ def add_attachments(*ruby_values)
303
+ ruby_values.do {|val| self.attach_property << RiCal::PropertyValue::Uri.convert(self, val)}
304
+ end
305
+
306
+ # add one value to the ATTACH property
307
+ # one instances of Uri may be passed to this method
308
+ def add_attach(ruby_value)
309
+ self.attach_property << RiCal::PropertyValue::Uri.convert(self, ruby_value)
310
+ end
311
+
312
+ # remove one or more values from the ATTACH property
313
+ # one or more instances of Uri may be passed to this method
314
+ def remove_attachments(*ruby_values)
315
+ ruby_values.do {|val| self.attach_property.delete(RiCal::PropertyValue::Uri.convert(self, val))}
316
+ end
317
+
318
+ # remove one value from the ATTACH property
319
+ # one instances of Uri may be passed to this method
320
+ def remove_attach(ruby_value)
321
+ self.attach_property.delete(RiCal::PropertyValue::Uri.convert(self, ruby_value))
322
+ end
323
+
324
+ # return the value of the ATTACH property
325
+ # which will be an array of instances of Uri
326
+ def attach
327
+ attach_property.map {|prop| prop ? prop.value : prop}
328
+ end
329
+
330
+ def attach_property_from_string(line) # :nodoc:
331
+ attach_property << RiCal::PropertyValue::Uri.new(self, line)
332
+ end
333
+
334
+ def export_properties_to(export_stream) #:nodoc:
335
+ export_prop_to(export_stream, "ACTION", @action_property)
336
+ export_prop_to(export_stream, "ATTENDEE", @attendee_property)
337
+ export_prop_to(export_stream, "DURATION", @duration_property)
338
+ export_prop_to(export_stream, "TRIGGER", @trigger_property)
339
+ export_prop_to(export_stream, "DESCRIPTION", @description_property)
340
+ export_prop_to(export_stream, "SUMMARY", @summary_property)
341
+ export_prop_to(export_stream, "REPEAT", @repeat_property)
342
+ export_prop_to(export_stream, "ATTACH", @attach_property)
343
+ end
344
+
345
+ def ==(o) #:nodoc:
346
+ if o.class == self.class
347
+ (action_property == o.action_property) &&
348
+ (attendee_property == o.attendee_property) &&
349
+ (duration_property == o.duration_property) &&
350
+ (trigger_property == o.trigger_property) &&
351
+ (description_property == o.description_property) &&
352
+ (summary_property == o.summary_property) &&
353
+ (repeat_property == o.repeat_property) &&
354
+ (attach_property == o.attach_property)
355
+ else
356
+ super
357
+ end
358
+ end
359
+
360
+ def initialize_copy(o) #:nodoc:
361
+ super
362
+ action_property = action_property && action_property.dup
363
+ attendee_property = attendee_property && attendee_property.dup
364
+ duration_property = duration_property && duration_property.dup
365
+ trigger_property = trigger_property && trigger_property.dup
366
+ description_property = description_property && description_property.dup
367
+ summary_property = summary_property && summary_property.dup
368
+ repeat_property = repeat_property && repeat_property.dup
369
+ attach_property = attach_property && attach_property.dup
370
+ end
371
+
372
+ def add_date_times_to(required_timezones) #:nodoc:
373
+ end
374
+
375
+ module ClassMethods #:nodoc:
376
+ def property_parser #:nodoc:
377
+ {"ACTION"=>:action_property_from_string, "ATTACH"=>:attach_property_from_string, "REPEAT"=>:repeat_property_from_string, "SUMMARY"=>:summary_property_from_string, "TRIGGER"=>:trigger_property_from_string, "ATTENDEE"=>:attendee_property_from_string, "DURATION"=>:duration_property_from_string, "DESCRIPTION"=>:description_property_from_string}
378
+ end
379
+ end
380
+
381
+ def self.included(mod) #:nodoc:
382
+ mod.extend ClassMethods
383
+ end
384
+
385
+ def mutual_exclusion_violation #:nodoc:
386
+ false
387
+ end
388
+ end
389
+ end
390
+ end
@@ -0,0 +1,164 @@
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::Calendar provides property accessing methods for the Calendar class
7
+ # This source file is generated by the rical:gen_propmodules rake tasks, DO NOT EDIT
8
+ module Calendar
9
+
10
+ # return the the CALSCALE property
11
+ # which will be an instances of RiCal::PropertyValueText
12
+ #
13
+ # [purpose (from RFC 2445)]
14
+ # This property defines the calendar scale used for the calendar information specified in the calendar object.
15
+ #
16
+ # see RFC 2445 4.7.1 p 73
17
+ def calscale_property
18
+ @calscale_property ||= RiCal::PropertyValue::Text.convert(self, "GREGORIAN")
19
+ end
20
+
21
+ # return the value of the CALSCALE property
22
+ # which will be an instance of String
23
+ def calscale
24
+ calscale_property ? calscale_property.ruby_value : nil
25
+ end
26
+
27
+ def calscale_property_from_string(line) # :nodoc:
28
+ @calscale_property = RiCal::PropertyValue::Text.new(self, line)
29
+ end
30
+
31
+
32
+ # return the the METHOD property
33
+ # which will be an instances of RiCal::PropertyValueText
34
+ #
35
+ # [purpose (from RFC 2445)]
36
+ # This property defines the iCalendar object method associated with the calendar object
37
+ #
38
+ # see RFC 2445 4.7.2 p 74-75
39
+ def method_property
40
+ @method_property
41
+ end
42
+
43
+ # set the METHOD property
44
+ # property value should be an instance of RiCal::PropertyValueText
45
+ def method_property=(property_value)
46
+ @method_property = property_value
47
+ end
48
+
49
+ # set the value of the METHOD property
50
+ def icalendar_method=(ruby_value)
51
+ self.method_property= RiCal::PropertyValue::Text.convert(self, ruby_value)
52
+ end
53
+
54
+ # return the value of the METHOD property
55
+ # which will be an instance of String
56
+ def icalendar_method
57
+ method_property ? method_property.ruby_value : nil
58
+ end
59
+
60
+ def method_property_from_string(line) # :nodoc:
61
+ @method_property = RiCal::PropertyValue::Text.new(self, line)
62
+ end
63
+
64
+
65
+ # return the the PRODID property
66
+ # which will be an instances of RiCal::PropertyValueText
67
+ #
68
+ # [purpose (from RFC 2445)]
69
+ # This property specifies the identifier for the product that created the iCalendar object.
70
+ #
71
+ # see RFC 2445 4.7.3 pp 75-76
72
+ def prodid_property
73
+ @prodid_property ||= RiCal::PropertyValue::Text.convert(self, "-//com.denhaven2/NONSGML ri_cal gem//EN")
74
+ end
75
+
76
+ # set the PRODID property
77
+ # property value should be an instance of RiCal::PropertyValueText
78
+ def prodid_property=(property_value)
79
+ @prodid_property = property_value
80
+ end
81
+
82
+ # set the value of the PRODID property
83
+ def prodid=(ruby_value)
84
+ self.prodid_property= RiCal::PropertyValue::Text.convert(self, ruby_value)
85
+ end
86
+
87
+ # return the value of the PRODID property
88
+ # which will be an instance of String
89
+ def prodid
90
+ prodid_property ? prodid_property.ruby_value : nil
91
+ end
92
+
93
+ def prodid_property_from_string(line) # :nodoc:
94
+ @prodid_property = RiCal::PropertyValue::Text.new(self, line)
95
+ end
96
+
97
+
98
+ # return the the VERSION property
99
+ # which will be an instances of RiCal::PropertyValueText
100
+ #
101
+ # [purpose (from RFC 2445)]
102
+ # This property specifies the identifier corresponding to thehighest version number or the minimum and maximum range of the iCalendar specification that is required in order to interpret the iCalendar object.
103
+ #
104
+ # see RFC 2445 4.7.4 pp 76-77
105
+ def version_property
106
+ @version_property ||= RiCal::PropertyValue::Text.convert(self, "2.0")
107
+ end
108
+
109
+ # return the value of the VERSION property
110
+ # which will be an instance of String
111
+ def version
112
+ version_property ? version_property.ruby_value : nil
113
+ end
114
+
115
+ def version_property_from_string(line) # :nodoc:
116
+ @version_property = RiCal::PropertyValue::Text.new(self, line)
117
+ end
118
+
119
+
120
+ def export_properties_to(export_stream) #:nodoc:
121
+ export_prop_to(export_stream, "PRODID", @prodid_property)
122
+ export_prop_to(export_stream, "CALSCALE", @calscale_property)
123
+ export_prop_to(export_stream, "VERSION", @version_property)
124
+ export_prop_to(export_stream, "METHOD", @method_property)
125
+ end
126
+
127
+ def ==(o) #:nodoc:
128
+ if o.class == self.class
129
+ (prodid_property == o.prodid_property) &&
130
+ (calscale_property == o.calscale_property) &&
131
+ (version_property == o.version_property) &&
132
+ (method_property == o.method_property)
133
+ else
134
+ super
135
+ end
136
+ end
137
+
138
+ def initialize_copy(o) #:nodoc:
139
+ super
140
+ prodid_property = prodid_property && prodid_property.dup
141
+ calscale_property = calscale_property && calscale_property.dup
142
+ version_property = version_property && version_property.dup
143
+ method_property = method_property && method_property.dup
144
+ end
145
+
146
+ def add_date_times_to(required_timezones) #:nodoc:
147
+ end
148
+
149
+ module ClassMethods #:nodoc:
150
+ def property_parser #:nodoc:
151
+ {"METHOD"=>:method_property_from_string, "VERSION"=>:version_property_from_string, "PRODID"=>:prodid_property_from_string, "CALSCALE"=>:calscale_property_from_string}
152
+ end
153
+ end
154
+
155
+ def self.included(mod) #:nodoc:
156
+ mod.extend ClassMethods
157
+ end
158
+
159
+ def mutual_exclusion_violation #:nodoc:
160
+ false
161
+ end
162
+ end
163
+ end
164
+ end