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