icalendar 0.96.3 → 0.96.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/docs/api/classes/HashAttrs.html +18 -18
- data/docs/api/classes/Icalendar/Alarm.html +44 -8
- data/docs/api/classes/Icalendar/Calendar.html +36 -36
- data/docs/api/classes/Icalendar/Component.html +259 -258
- data/docs/api/classes/Icalendar/Daylight.html +10 -10
- data/docs/api/classes/Icalendar/Event.html +12 -12
- data/docs/api/classes/Icalendar/Freebusy.html +10 -10
- data/docs/api/classes/Icalendar/Parameter.html +6 -6
- data/docs/api/classes/Icalendar/Standard.html +4 -4
- data/docs/api/classes/Icalendar/Timezone.html +42 -10
- data/docs/api/classes/URI/Generic.html +6 -6
- data/docs/api/created.rid +1 -1
- data/docs/api/files/lib/icalendar/component/alarm_rb.html +1 -1
- data/docs/api/files/lib/icalendar/component/freebusy_rb.html +1 -1
- data/docs/api/files/lib/icalendar/component/timezone_rb.html +1 -1
- data/docs/api/files/lib/icalendar/component_rb.html +1 -1
- data/docs/api/files/lib/icalendar/conversions_rb.html +1 -1
- data/docs/api/files/lib/icalendar/parser_rb.html +1 -1
- data/docs/api/fr_method_index.html +36 -35
- data/lib/icalendar/component.rb +1 -0
- data/lib/icalendar/component/alarm.rb +6 -2
- data/lib/icalendar/component/freebusy.rb +13 -14
- data/lib/icalendar/component/timezone.rb +11 -0
- data/test/life.ics +1092 -46
- data/test/old_life.ics +46 -0
- data/test/read_write.rb +23 -0
- data/test/rw.ics +947 -0
- metadata +5 -2
data/Rakefile
CHANGED
@@ -86,9 +86,9 @@ A module which adds some generators for hash based accessors.
|
|
86
86
|
<h3 class="section-bar">Methods</h3>
|
87
87
|
|
88
88
|
<div class="name-list">
|
89
|
-
<a href="#
|
90
|
-
<a href="#
|
91
|
-
<a href="#
|
89
|
+
<a href="#M000054">hash_accessor</a>
|
90
|
+
<a href="#M000052">hash_reader</a>
|
91
|
+
<a href="#M000053">hash_writer</a>
|
92
92
|
</div>
|
93
93
|
</div>
|
94
94
|
|
@@ -110,19 +110,19 @@ A module which adds some generators for hash based accessors.
|
|
110
110
|
<div id="methods">
|
111
111
|
<h3 class="section-bar">Public Instance methods</h3>
|
112
112
|
|
113
|
-
<div id="method-
|
114
|
-
<a name="
|
113
|
+
<div id="method-M000054" class="method-detail">
|
114
|
+
<a name="M000054"></a>
|
115
115
|
|
116
116
|
<div class="method-heading">
|
117
|
-
<a href="#
|
117
|
+
<a href="#M000054" class="method-signature">
|
118
118
|
<span class="method-name">hash_accessor</span><span class="method-args">(hash, *syms)</span>
|
119
119
|
</a>
|
120
120
|
</div>
|
121
121
|
|
122
122
|
<div class="method-description">
|
123
123
|
<p><a class="source-toggle" href="#"
|
124
|
-
onclick="toggleCode('
|
125
|
-
<div class="method-source-code" id="
|
124
|
+
onclick="toggleCode('M000054-source');return false;">[Source]</a></p>
|
125
|
+
<div class="method-source-code" id="M000054-source">
|
126
126
|
<pre>
|
127
127
|
<span class="ruby-comment cmt"># File lib/hash_attrs.rb, line 29</span>
|
128
128
|
29: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hash_accessor</span>(<span class="ruby-identifier">hash</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">syms</span>)
|
@@ -134,19 +134,19 @@ A module which adds some generators for hash based accessors.
|
|
134
134
|
</div>
|
135
135
|
</div>
|
136
136
|
|
137
|
-
<div id="method-
|
138
|
-
<a name="
|
137
|
+
<div id="method-M000052" class="method-detail">
|
138
|
+
<a name="M000052"></a>
|
139
139
|
|
140
140
|
<div class="method-heading">
|
141
|
-
<a href="#
|
141
|
+
<a href="#M000052" class="method-signature">
|
142
142
|
<span class="method-name">hash_reader</span><span class="method-args">(hash_sym, syms)</span>
|
143
143
|
</a>
|
144
144
|
</div>
|
145
145
|
|
146
146
|
<div class="method-description">
|
147
147
|
<p><a class="source-toggle" href="#"
|
148
|
-
onclick="toggleCode('
|
149
|
-
<div class="method-source-code" id="
|
148
|
+
onclick="toggleCode('M000052-source');return false;">[Source]</a></p>
|
149
|
+
<div class="method-source-code" id="M000052-source">
|
150
150
|
<pre>
|
151
151
|
<span class="ruby-comment cmt"># File lib/hash_attrs.rb, line 4</span>
|
152
152
|
4: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hash_reader</span>(<span class="ruby-identifier">hash_sym</span>, <span class="ruby-identifier">syms</span>)
|
@@ -165,19 +165,19 @@ A module which adds some generators for hash based accessors.
|
|
165
165
|
</div>
|
166
166
|
</div>
|
167
167
|
|
168
|
-
<div id="method-
|
169
|
-
<a name="
|
168
|
+
<div id="method-M000053" class="method-detail">
|
169
|
+
<a name="M000053"></a>
|
170
170
|
|
171
171
|
<div class="method-heading">
|
172
|
-
<a href="#
|
172
|
+
<a href="#M000053" class="method-signature">
|
173
173
|
<span class="method-name">hash_writer</span><span class="method-args">(hash_sym, syms)</span>
|
174
174
|
</a>
|
175
175
|
</div>
|
176
176
|
|
177
177
|
<div class="method-description">
|
178
178
|
<p><a class="source-toggle" href="#"
|
179
|
-
onclick="toggleCode('
|
180
|
-
<div class="method-source-code" id="
|
179
|
+
onclick="toggleCode('M000053-source');return false;">[Source]</a></p>
|
180
|
+
<div class="method-source-code" id="M000053-source">
|
181
181
|
<pre>
|
182
182
|
<span class="ruby-comment cmt"># File lib/hash_attrs.rb, line 16</span>
|
183
183
|
16: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hash_writer</span>(<span class="ruby-identifier">hash_sym</span>, <span class="ruby-identifier">syms</span>)
|
@@ -128,22 +128,53 @@ Single properties
|
|
128
128
|
<tr class="top-aligned-row context-row">
|
129
129
|
<td class="context-item-name">attach</td>
|
130
130
|
<td class="context-item-value"> </td>
|
131
|
+
<td class="context-item-desc"></td>
|
132
|
+
</tr>
|
133
|
+
<tr class="top-aligned-row context-row">
|
134
|
+
<td class="context-item-name">attachment</td>
|
135
|
+
<td class="context-item-value"> </td>
|
136
|
+
<td class="context-item-desc"></td>
|
137
|
+
</tr>
|
138
|
+
<tr class="top-aligned-row context-row">
|
139
|
+
<td class="context-item-name">attachments</td>
|
140
|
+
<td class="context-item-value"> </td>
|
141
|
+
<td class="context-item-desc"></td>
|
142
|
+
</tr>
|
143
|
+
<tr class="top-aligned-row context-row">
|
144
|
+
<td class="context-item-name">attendee</td>
|
145
|
+
<td class="context-item-value"> </td>
|
131
146
|
<td class="context-item-desc">
|
132
|
-
|
147
|
+
Multi properties
|
133
148
|
|
134
149
|
</td>
|
135
150
|
</tr>
|
136
151
|
<tr class="top-aligned-row context-row">
|
137
|
-
<td class="context-item-name">
|
152
|
+
<td class="context-item-name">attendee</td>
|
138
153
|
<td class="context-item-value"> </td>
|
139
154
|
<td class="context-item-desc">
|
140
|
-
|
155
|
+
Multi properties
|
156
|
+
|
157
|
+
</td>
|
158
|
+
</tr>
|
159
|
+
<tr class="top-aligned-row context-row">
|
160
|
+
<td class="context-item-name">attendees</td>
|
161
|
+
<td class="context-item-value"> </td>
|
162
|
+
<td class="context-item-desc">
|
163
|
+
Multi properties
|
141
164
|
|
142
165
|
</td>
|
143
166
|
</tr>
|
144
167
|
<tr class="top-aligned-row context-row">
|
145
168
|
<td class="context-item-name">created</td>
|
146
169
|
<td class="context-item-value"> </td>
|
170
|
+
<td class="context-item-desc">
|
171
|
+
Single and only occurring once
|
172
|
+
|
173
|
+
</td>
|
174
|
+
</tr>
|
175
|
+
<tr class="top-aligned-row context-row">
|
176
|
+
<td class="context-item-name">description</td>
|
177
|
+
<td class="context-item-value"> </td>
|
147
178
|
<td class="context-item-desc"></td>
|
148
179
|
</tr>
|
149
180
|
<tr class="top-aligned-row context-row">
|
@@ -169,6 +200,11 @@ Single but must appear together
|
|
169
200
|
<td class="context-item-value"> </td>
|
170
201
|
<td class="context-item-desc"></td>
|
171
202
|
</tr>
|
203
|
+
<tr class="top-aligned-row context-row">
|
204
|
+
<td class="context-item-name">summary</td>
|
205
|
+
<td class="context-item-value"> </td>
|
206
|
+
<td class="context-item-desc"></td>
|
207
|
+
</tr>
|
172
208
|
<tr class="top-aligned-row context-row">
|
173
209
|
<td class="context-item-name">timestamp</td>
|
174
210
|
<td class="context-item-value"> </td>
|
@@ -203,11 +239,11 @@ Single but must appear together
|
|
203
239
|
onclick="toggleCode('M000021-source');return false;">[Source]</a></p>
|
204
240
|
<div class="method-source-code" id="M000021-source">
|
205
241
|
<pre>
|
206
|
-
<span class="ruby-comment cmt"># File lib/icalendar/component/alarm.rb, line
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
242
|
+
<span class="ruby-comment cmt"># File lib/icalendar/component/alarm.rb, line 36</span>
|
243
|
+
36: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>()
|
244
|
+
37: <span class="ruby-keyword kw">super</span>(<span class="ruby-value str">"VALARM"</span>)
|
245
|
+
38:
|
246
|
+
39: <span class="ruby-keyword kw">end</span>
|
211
247
|
</pre>
|
212
248
|
</div>
|
213
249
|
</div>
|
@@ -88,12 +88,12 @@
|
|
88
88
|
<h3 class="section-bar">Methods</h3>
|
89
89
|
|
90
90
|
<div class="name-list">
|
91
|
-
<a href="#
|
92
|
-
<a href="#
|
93
|
-
<a href="#
|
94
|
-
<a href="#
|
95
|
-
<a href="#
|
96
|
-
<a href="#
|
91
|
+
<a href="#M000044">event</a>
|
92
|
+
<a href="#M000047">freebusy</a>
|
93
|
+
<a href="#M000046">journal</a>
|
94
|
+
<a href="#M000043">new</a>
|
95
|
+
<a href="#M000048">timezone</a>
|
96
|
+
<a href="#M000045">todo</a>
|
97
97
|
</div>
|
98
98
|
</div>
|
99
99
|
|
@@ -178,19 +178,19 @@
|
|
178
178
|
<div id="methods">
|
179
179
|
<h3 class="section-bar">Public Class methods</h3>
|
180
180
|
|
181
|
-
<div id="method-
|
182
|
-
<a name="
|
181
|
+
<div id="method-M000043" class="method-detail">
|
182
|
+
<a name="M000043"></a>
|
183
183
|
|
184
184
|
<div class="method-heading">
|
185
|
-
<a href="#
|
185
|
+
<a href="#M000043" class="method-signature">
|
186
186
|
<span class="method-name">new</span><span class="method-args">()</span>
|
187
187
|
</a>
|
188
188
|
</div>
|
189
189
|
|
190
190
|
<div class="method-description">
|
191
191
|
<p><a class="source-toggle" href="#"
|
192
|
-
onclick="toggleCode('
|
193
|
-
<div class="method-source-code" id="
|
192
|
+
onclick="toggleCode('M000043-source');return false;">[Source]</a></p>
|
193
|
+
<div class="method-source-code" id="M000043-source">
|
194
194
|
<pre>
|
195
195
|
<span class="ruby-comment cmt"># File lib/icalendar/calendar.rb, line 19</span>
|
196
196
|
19: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>()
|
@@ -210,19 +210,19 @@
|
|
210
210
|
|
211
211
|
<h3 class="section-bar">Public Instance methods</h3>
|
212
212
|
|
213
|
-
<div id="method-
|
214
|
-
<a name="
|
213
|
+
<div id="method-M000044" class="method-detail">
|
214
|
+
<a name="M000044"></a>
|
215
215
|
|
216
216
|
<div class="method-heading">
|
217
|
-
<a href="#
|
217
|
+
<a href="#M000044" class="method-signature">
|
218
218
|
<span class="method-name">event</span><span class="method-args">(&block)</span>
|
219
219
|
</a>
|
220
220
|
</div>
|
221
221
|
|
222
222
|
<div class="method-description">
|
223
223
|
<p><a class="source-toggle" href="#"
|
224
|
-
onclick="toggleCode('
|
225
|
-
<div class="method-source-code" id="
|
224
|
+
onclick="toggleCode('M000044-source');return false;">[Source]</a></p>
|
225
|
+
<div class="method-source-code" id="M000044-source">
|
226
226
|
<pre>
|
227
227
|
<span class="ruby-comment cmt"># File lib/icalendar/calendar.rb, line 30</span>
|
228
228
|
30: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">event</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
@@ -238,19 +238,19 @@
|
|
238
238
|
</div>
|
239
239
|
</div>
|
240
240
|
|
241
|
-
<div id="method-
|
242
|
-
<a name="
|
241
|
+
<div id="method-M000047" class="method-detail">
|
242
|
+
<a name="M000047"></a>
|
243
243
|
|
244
244
|
<div class="method-heading">
|
245
|
-
<a href="#
|
245
|
+
<a href="#M000047" class="method-signature">
|
246
246
|
<span class="method-name">freebusy</span><span class="method-args">(&block)</span>
|
247
247
|
</a>
|
248
248
|
</div>
|
249
249
|
|
250
250
|
<div class="method-description">
|
251
251
|
<p><a class="source-toggle" href="#"
|
252
|
-
onclick="toggleCode('
|
253
|
-
<div class="method-source-code" id="
|
252
|
+
onclick="toggleCode('M000047-source');return false;">[Source]</a></p>
|
253
|
+
<div class="method-source-code" id="M000047-source">
|
254
254
|
<pre>
|
255
255
|
<span class="ruby-comment cmt"># File lib/icalendar/calendar.rb, line 57</span>
|
256
256
|
57: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">freebusy</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
@@ -266,19 +266,19 @@
|
|
266
266
|
</div>
|
267
267
|
</div>
|
268
268
|
|
269
|
-
<div id="method-
|
270
|
-
<a name="
|
269
|
+
<div id="method-M000046" class="method-detail">
|
270
|
+
<a name="M000046"></a>
|
271
271
|
|
272
272
|
<div class="method-heading">
|
273
|
-
<a href="#
|
273
|
+
<a href="#M000046" class="method-signature">
|
274
274
|
<span class="method-name">journal</span><span class="method-args">(&block)</span>
|
275
275
|
</a>
|
276
276
|
</div>
|
277
277
|
|
278
278
|
<div class="method-description">
|
279
279
|
<p><a class="source-toggle" href="#"
|
280
|
-
onclick="toggleCode('
|
281
|
-
<div class="method-source-code" id="
|
280
|
+
onclick="toggleCode('M000046-source');return false;">[Source]</a></p>
|
281
|
+
<div class="method-source-code" id="M000046-source">
|
282
282
|
<pre>
|
283
283
|
<span class="ruby-comment cmt"># File lib/icalendar/calendar.rb, line 48</span>
|
284
284
|
48: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">journal</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
@@ -294,19 +294,19 @@
|
|
294
294
|
</div>
|
295
295
|
</div>
|
296
296
|
|
297
|
-
<div id="method-
|
298
|
-
<a name="
|
297
|
+
<div id="method-M000048" class="method-detail">
|
298
|
+
<a name="M000048"></a>
|
299
299
|
|
300
300
|
<div class="method-heading">
|
301
|
-
<a href="#
|
301
|
+
<a href="#M000048" class="method-signature">
|
302
302
|
<span class="method-name">timezone</span><span class="method-args">(&block)</span>
|
303
303
|
</a>
|
304
304
|
</div>
|
305
305
|
|
306
306
|
<div class="method-description">
|
307
307
|
<p><a class="source-toggle" href="#"
|
308
|
-
onclick="toggleCode('
|
309
|
-
<div class="method-source-code" id="
|
308
|
+
onclick="toggleCode('M000048-source');return false;">[Source]</a></p>
|
309
|
+
<div class="method-source-code" id="M000048-source">
|
310
310
|
<pre>
|
311
311
|
<span class="ruby-comment cmt"># File lib/icalendar/calendar.rb, line 66</span>
|
312
312
|
66: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">timezone</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
@@ -322,19 +322,19 @@
|
|
322
322
|
</div>
|
323
323
|
</div>
|
324
324
|
|
325
|
-
<div id="method-
|
326
|
-
<a name="
|
325
|
+
<div id="method-M000045" class="method-detail">
|
326
|
+
<a name="M000045"></a>
|
327
327
|
|
328
328
|
<div class="method-heading">
|
329
|
-
<a href="#
|
329
|
+
<a href="#M000045" class="method-signature">
|
330
330
|
<span class="method-name">todo</span><span class="method-args">(&block)</span>
|
331
331
|
</a>
|
332
332
|
</div>
|
333
333
|
|
334
334
|
<div class="method-description">
|
335
335
|
<p><a class="source-toggle" href="#"
|
336
|
-
onclick="toggleCode('
|
337
|
-
<div class="method-source-code" id="
|
336
|
+
onclick="toggleCode('M000045-source');return false;">[Source]</a></p>
|
337
|
+
<div class="method-source-code" id="M000045-source">
|
338
338
|
<pre>
|
339
339
|
<span class="ruby-comment cmt"># File lib/icalendar/calendar.rb, line 39</span>
|
340
340
|
39: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">todo</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
@@ -102,20 +102,20 @@ an <a href="Alarm.html">Alarm</a>.
|
|
102
102
|
<h3 class="section-bar">Methods</h3>
|
103
103
|
|
104
104
|
<div class="name-list">
|
105
|
-
<a href="#
|
106
|
-
<a href="#
|
107
|
-
<a href="#
|
108
|
-
<a href="#
|
109
|
-
<a href="#
|
110
|
-
<a href="#
|
111
|
-
<a href="#
|
112
|
-
<a href="#
|
113
|
-
<a href="#
|
114
|
-
<a href="#
|
115
|
-
<a href="#
|
116
|
-
<a href="#
|
117
|
-
<a href="#
|
118
|
-
<a href="#
|
105
|
+
<a href="#M000028">add</a>
|
106
|
+
<a href="#M000027">add_component</a>
|
107
|
+
<a href="#M000033">custom_property</a>
|
108
|
+
<a href="#M000035">ical_component</a>
|
109
|
+
<a href="#M000037">ical_multi_property</a>
|
110
|
+
<a href="#M000036">ical_property</a>
|
111
|
+
<a href="#M000038">method_missing</a>
|
112
|
+
<a href="#M000034">multi_property?</a>
|
113
|
+
<a href="#M000026">new</a>
|
114
|
+
<a href="#M000030">print_component</a>
|
115
|
+
<a href="#M000032">print_parameter</a>
|
116
|
+
<a href="#M000031">print_properties</a>
|
117
|
+
<a href="#M000039">respond_to?</a>
|
118
|
+
<a href="#M000029">to_ical</a>
|
119
119
|
</div>
|
120
120
|
</div>
|
121
121
|
|
@@ -160,19 +160,19 @@ an <a href="Alarm.html">Alarm</a>.
|
|
160
160
|
<div id="methods">
|
161
161
|
<h3 class="section-bar">Public Class methods</h3>
|
162
162
|
|
163
|
-
<div id="method-
|
164
|
-
<a name="
|
163
|
+
<div id="method-M000026" class="method-detail">
|
164
|
+
<a name="M000026"></a>
|
165
165
|
|
166
166
|
<div class="method-heading">
|
167
|
-
<a href="#
|
167
|
+
<a href="#M000026" class="method-signature">
|
168
168
|
<span class="method-name">new</span><span class="method-args">(name)</span>
|
169
169
|
</a>
|
170
170
|
</div>
|
171
171
|
|
172
172
|
<div class="method-description">
|
173
173
|
<p><a class="source-toggle" href="#"
|
174
|
-
onclick="toggleCode('
|
175
|
-
<div class="method-source-code" id="
|
174
|
+
onclick="toggleCode('M000026-source');return false;">[Source]</a></p>
|
175
|
+
<div class="method-source-code" id="M000026-source">
|
176
176
|
<pre>
|
177
177
|
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 26</span>
|
178
178
|
26: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">name</span>)
|
@@ -190,11 +190,11 @@ an <a href="Alarm.html">Alarm</a>.
|
|
190
190
|
|
191
191
|
<h3 class="section-bar">Protected Class methods</h3>
|
192
192
|
|
193
|
-
<div id="method-
|
194
|
-
<a name="
|
193
|
+
<div id="method-M000035" class="method-detail">
|
194
|
+
<a name="M000035"></a>
|
195
195
|
|
196
196
|
<div class="method-heading">
|
197
|
-
<a href="#
|
197
|
+
<a href="#M000035" class="method-signature">
|
198
198
|
<span class="method-name">ical_component</span><span class="method-args">(*syms)</span>
|
199
199
|
</a>
|
200
200
|
</div>
|
@@ -204,23 +204,23 @@ an <a href="Alarm.html">Alarm</a>.
|
|
204
204
|
Make it protected so we can monitor usage…
|
205
205
|
</p>
|
206
206
|
<p><a class="source-toggle" href="#"
|
207
|
-
onclick="toggleCode('
|
208
|
-
<div class="method-source-code" id="
|
207
|
+
onclick="toggleCode('M000035-source');return false;">[Source]</a></p>
|
208
|
+
<div class="method-source-code" id="M000035-source">
|
209
209
|
<pre>
|
210
|
-
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line
|
211
|
-
|
212
|
-
|
213
|
-
|
210
|
+
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 130</span>
|
211
|
+
130: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Component</span>.<span class="ruby-identifier">ical_component</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">syms</span>)
|
212
|
+
131: <span class="ruby-identifier">hash_accessor</span> <span class="ruby-identifier">:@components</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">syms</span>
|
213
|
+
132: <span class="ruby-keyword kw">end</span>
|
214
214
|
</pre>
|
215
215
|
</div>
|
216
216
|
</div>
|
217
217
|
</div>
|
218
218
|
|
219
|
-
<div id="method-
|
220
|
-
<a name="
|
219
|
+
<div id="method-M000037" class="method-detail">
|
220
|
+
<a name="M000037"></a>
|
221
221
|
|
222
222
|
<div class="method-heading">
|
223
|
-
<a href="#
|
223
|
+
<a href="#M000037" class="method-signature">
|
224
224
|
<span class="method-name">ical_multi_property</span><span class="method-args">(property, singular, plural)</span>
|
225
225
|
</a>
|
226
226
|
</div>
|
@@ -231,73 +231,73 @@ Define a set of methods defining a new property, which supports multiple
|
|
231
231
|
values for the same property name.
|
232
232
|
</p>
|
233
233
|
<p><a class="source-toggle" href="#"
|
234
|
-
onclick="toggleCode('
|
235
|
-
<div class="method-source-code" id="
|
234
|
+
onclick="toggleCode('M000037-source');return false;">[Source]</a></p>
|
235
|
+
<div class="method-source-code" id="M000037-source">
|
236
236
|
<pre>
|
237
|
-
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
237
|
+
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 202</span>
|
238
|
+
202: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Component</span>.<span class="ruby-identifier">ical_multi_property</span>(<span class="ruby-identifier">property</span>, <span class="ruby-identifier">singular</span>, <span class="ruby-identifier">plural</span>)
|
239
|
+
203: <span class="ruby-identifier">property</span> = <span class="ruby-node">"#{property}"</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">upcase</span>
|
240
|
+
204: <span class="ruby-identifier">singular</span> = <span class="ruby-node">"#{singular}"</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">downcase</span>
|
241
|
+
205: <span class="ruby-identifier">plural</span> = <span class="ruby-node">"#{plural}"</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">downcase</span>
|
242
|
+
206:
|
243
|
+
207: <span class="ruby-identifier">getter</span> = <span class="ruby-node">"#{plural}"</span>
|
244
|
+
208: <span class="ruby-identifier">setter</span> = <span class="ruby-node">"#{plural}="</span>
|
245
|
+
209: <span class="ruby-identifier">adder</span> = <span class="ruby-node">"add_#{singular}"</span>
|
246
|
+
210: <span class="ruby-identifier">remover</span> = <span class="ruby-node">"remove_#{singular}"</span>
|
247
|
+
211: <span class="ruby-identifier">query</span> = <span class="ruby-node">"#{plural}?"</span>
|
248
|
+
212:
|
249
|
+
213: <span class="ruby-comment cmt"># Set this key so the parser knows to use an array for</span>
|
250
|
+
214: <span class="ruby-comment cmt"># storing this property type.</span>
|
251
|
+
215: <span class="ruby-ivar">@@multi_properties</span>[<span class="ruby-node">"#{property}"</span>] = <span class="ruby-keyword kw">true</span>
|
252
|
+
216:
|
253
|
+
217: <span class="ruby-comment cmt"># Getter for whole array</span>
|
254
|
+
218: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">instance_methods</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">getter</span>
|
255
|
+
219: <span class="ruby-identifier">code</span> = <span class="ruby-value str">"def \#{getter}(*a)\nif a.empty?\nif @properties.has_key?(\"\#{property}\")\n@properties[\"\#{property}\"]\nelse\n[]\nend\nelse\nself.\#{setter}(a.first)\nend\nend\n"</span>
|
256
|
+
220:
|
257
|
+
221: <span class="ruby-identifier">class_eval</span> <span class="ruby-identifier">code</span>, <span class="ruby-value str">"component.rb"</span>, <span class="ruby-value">186</span>
|
258
|
+
222: <span class="ruby-keyword kw">end</span>
|
259
|
+
223:
|
260
|
+
224: <span class="ruby-comment cmt"># Setter for whole array</span>
|
261
|
+
225: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">instance_methods</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">setter</span>
|
262
|
+
226: <span class="ruby-identifier">code</span> = <span class="ruby-value str">"def \#{setter}(a)\nif a.respond_to?(:to_ary)\na.to_ary.each do |val|\nunless val.respond_to?(:to_ical)\nraise(NotImplementedError, \"Property values do not support to_ical method!\")\nend\nend\n\n@properties[\"\#{property}\"] = a.to_ary\n\nelse\nraise ArgumentError, \"\#{getter} is a multi-property that must be an array! Use the \#{adder} method to add single entries.\"\nend\nend\n"</span>
|
263
|
+
227:
|
264
|
+
228: <span class="ruby-identifier">class_eval</span> <span class="ruby-identifier">code</span>, <span class="ruby-value str">"component.rb"</span>, <span class="ruby-value">198</span>
|
265
|
+
229: <span class="ruby-keyword kw">end</span>
|
266
|
+
230:
|
267
|
+
231: <span class="ruby-comment cmt"># Query for any of these properties</span>
|
268
|
+
232: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">instance_methods</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">query</span>
|
269
|
+
233: <span class="ruby-identifier">code</span> = <span class="ruby-value str">"def \#{query}\n@properties.has_key?(\"\#{property}\")\nend\n"</span>
|
270
|
+
234:
|
271
|
+
235: <span class="ruby-identifier">class_eval</span> <span class="ruby-identifier">code</span>, <span class="ruby-value str">"component.rb"</span>, <span class="ruby-value">210</span>
|
272
|
+
236: <span class="ruby-keyword kw">end</span>
|
273
|
+
237:
|
274
|
+
238: <span class="ruby-comment cmt"># Add another item to this properties array</span>
|
275
|
+
239: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">instance_methods</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">adder</span>
|
276
|
+
240: <span class="ruby-identifier">code</span> = <span class="ruby-value str">"def \#{adder}(val, params = {})\nunless val.respond_to?(:to_ical)\nraise(NotImplementedError, \"Property value object does not support to_ical method!\")\nend\n\nif @properties.has_key?(\"\#{property}\")\n@properties[\"\#{property}\"] << val\nelse\n@properties[\"\#{property}\"] = [val]\nend\nend\n"</span>
|
277
|
+
241:
|
278
|
+
242: <span class="ruby-identifier">class_eval</span> <span class="ruby-identifier">code</span>, <span class="ruby-value str">"component.rb"</span>, <span class="ruby-value">228</span>
|
279
|
+
243: <span class="ruby-identifier">alias_method</span>(<span class="ruby-node">"add_#{property.downcase}"</span>, <span class="ruby-node">"#{adder}"</span>)
|
280
|
+
244: <span class="ruby-keyword kw">end</span>
|
281
|
+
245:
|
282
|
+
246: <span class="ruby-comment cmt"># Remove an item from this properties array</span>
|
283
|
+
247: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">instance_methods</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">remover</span>
|
284
|
+
248: <span class="ruby-identifier">code</span> = <span class="ruby-value str">"def \#{remover}(a)\nif @properties.has_key?(\"\#{property}\")\n@properties[\"\#{property}\"].delete(a)\nend\nend\n"</span>
|
285
|
+
249:
|
286
|
+
250: <span class="ruby-identifier">class_eval</span> <span class="ruby-identifier">code</span>, <span class="ruby-value str">"component.rb"</span>, <span class="ruby-value">241</span>
|
287
|
+
251: <span class="ruby-identifier">alias_method</span>(<span class="ruby-node">"remove_#{property.downcase}"</span>, <span class="ruby-node">"#{remover}"</span>)
|
288
|
+
252: <span class="ruby-keyword kw">end</span>
|
289
|
+
253:
|
290
|
+
254: <span class="ruby-keyword kw">end</span>
|
291
291
|
</pre>
|
292
292
|
</div>
|
293
293
|
</div>
|
294
294
|
</div>
|
295
295
|
|
296
|
-
<div id="method-
|
297
|
-
<a name="
|
296
|
+
<div id="method-M000036" class="method-detail">
|
297
|
+
<a name="M000036"></a>
|
298
298
|
|
299
299
|
<div class="method-heading">
|
300
|
-
<a href="#
|
300
|
+
<a href="#M000036" class="method-signature">
|
301
301
|
<span class="method-name">ical_property</span><span class="method-args">(property, alias_name = nil, prop_name = nil)</span>
|
302
302
|
</a>
|
303
303
|
</div>
|
@@ -307,50 +307,50 @@ values for the same property name.
|
|
307
307
|
Define a set of methods supporting a new property
|
308
308
|
</p>
|
309
309
|
<p><a class="source-toggle" href="#"
|
310
|
-
onclick="toggleCode('
|
311
|
-
<div class="method-source-code" id="
|
310
|
+
onclick="toggleCode('M000036-source');return false;">[Source]</a></p>
|
311
|
+
<div class="method-source-code" id="M000036-source">
|
312
312
|
<pre>
|
313
|
-
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
313
|
+
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 135</span>
|
314
|
+
135: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Component</span>.<span class="ruby-identifier">ical_property</span>(<span class="ruby-identifier">property</span>, <span class="ruby-identifier">alias_name</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">prop_name</span> = <span class="ruby-keyword kw">nil</span>)
|
315
|
+
136:
|
316
|
+
137: <span class="ruby-identifier">property</span> = <span class="ruby-node">"#{property}"</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">downcase</span>
|
317
|
+
138: <span class="ruby-identifier">getter</span> = <span class="ruby-node">"#{property}"</span>
|
318
|
+
139: <span class="ruby-identifier">setter</span> = <span class="ruby-node">"#{property}="</span>
|
319
|
+
140: <span class="ruby-identifier">query</span> = <span class="ruby-node">"#{property}?"</span>
|
320
|
+
141: <span class="ruby-identifier">alias_name</span> = <span class="ruby-node">"#{alias_name}"</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">alias_name</span>.<span class="ruby-identifier">nil?</span>
|
321
|
+
142:
|
322
|
+
143: <span class="ruby-comment cmt"># If a prop_name was given then we use that for the actual storage</span>
|
323
|
+
144: <span class="ruby-identifier">property</span> = <span class="ruby-node">"#{prop_name}"</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">upcase</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">prop_name</span>.<span class="ruby-identifier">nil?</span>
|
324
|
+
145:
|
325
|
+
146: <span class="ruby-comment cmt"># Change underscores in property name to a dash</span>
|
326
|
+
147: <span class="ruby-identifier">property</span>[<span class="ruby-regexp re">/_/</span>] = <span class="ruby-value str">'-'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">property</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/_/</span>
|
327
|
+
148:
|
328
|
+
149: <span class="ruby-comment cmt"># All properties names are stored in caps...</span>
|
329
|
+
150: <span class="ruby-identifier">property</span> = <span class="ruby-identifier">property</span>.<span class="ruby-identifier">upcase</span>
|
330
|
+
151:
|
331
|
+
152: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">instance_methods</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">getter</span>
|
332
|
+
153: <span class="ruby-identifier">code</span> = <span class="ruby-value str">"def \#{getter}(val = nil, params = {})\nif val.nil?\n@properties[\"\#{property}\"]\nelse\n# Set the value just like normal\nself.\#{setter}(val)\nend\nend\n"</span>
|
333
|
+
154:
|
334
|
+
155: <span class="ruby-identifier">class_eval</span> <span class="ruby-identifier">code</span>, <span class="ruby-value str">"component.rb"</span>, <span class="ruby-value">155</span>
|
335
|
+
156: <span class="ruby-identifier">alias_method</span>(<span class="ruby-node">"#{alias_name}"</span>, <span class="ruby-node">"#{getter}"</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">alias_name</span>.<span class="ruby-identifier">nil?</span>
|
336
|
+
157: <span class="ruby-keyword kw">end</span>
|
337
|
+
158:
|
338
|
+
159: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">instance_methods</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">setter</span>
|
339
|
+
160: <span class="ruby-identifier">code</span> = <span class="ruby-value str">"def \#{setter}(val)\nunless val.respond_to?(:to_ical)\nraise(NotImplementedError, \"Value of type (\" + val.class.to_s + \") does not support to_ical method!\")\nend\n\n@properties[\"\#{property}\"] = val\nend\n"</span>
|
340
|
+
161:
|
341
|
+
162: <span class="ruby-identifier">class_eval</span> <span class="ruby-identifier">code</span>, <span class="ruby-value str">"component.rb"</span>, <span class="ruby-value">171</span>
|
342
|
+
163:
|
343
|
+
164: <span class="ruby-identifier">alias_method</span>(<span class="ruby-node">"#{alias_name}="</span>, <span class="ruby-node">"#{setter}"</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">alias_name</span>.<span class="ruby-identifier">nil?</span>
|
344
|
+
165: <span class="ruby-keyword kw">end</span>
|
345
|
+
166:
|
346
|
+
167: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">instance_methods</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">query</span>
|
347
|
+
168: <span class="ruby-identifier">code</span> = <span class="ruby-value str">"def \#{query}\n@properties.has_key?(\"\#{property}\")\nend\n"</span>
|
348
|
+
169:
|
349
|
+
170: <span class="ruby-identifier">class_eval</span> <span class="ruby-identifier">code</span>, <span class="ruby-value str">"component.rb"</span>, <span class="ruby-value">183</span>
|
350
|
+
171:
|
351
|
+
172: <span class="ruby-identifier">alias_method</span>(<span class="ruby-node">"#{alias_name}\?"</span>, <span class="ruby-node">"#{query}"</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">alias_name</span>.<span class="ruby-identifier">nil?</span>
|
352
|
+
173: <span class="ruby-keyword kw">end</span>
|
353
|
+
174: <span class="ruby-keyword kw">end</span>
|
354
354
|
</pre>
|
355
355
|
</div>
|
356
356
|
</div>
|
@@ -358,8 +358,8 @@ Define a set of methods supporting a new property
|
|
358
358
|
|
359
359
|
<h3 class="section-bar">Public Instance methods</h3>
|
360
360
|
|
361
|
-
<div id="method-
|
362
|
-
<a name="
|
361
|
+
<div id="method-M000028" class="method-detail">
|
362
|
+
<a name="M000028"></a>
|
363
363
|
|
364
364
|
<div class="method-heading">
|
365
365
|
<span class="method-name">add</span><span class="method-args">(component)</span>
|
@@ -367,16 +367,16 @@ Define a set of methods supporting a new property
|
|
367
367
|
|
368
368
|
<div class="method-description">
|
369
369
|
<p>
|
370
|
-
Alias for <a href="Component.html#
|
370
|
+
Alias for <a href="Component.html#M000027">add_component</a>
|
371
371
|
</p>
|
372
372
|
</div>
|
373
373
|
</div>
|
374
374
|
|
375
|
-
<div id="method-
|
376
|
-
<a name="
|
375
|
+
<div id="method-M000027" class="method-detail">
|
376
|
+
<a name="M000027"></a>
|
377
377
|
|
378
378
|
<div class="method-heading">
|
379
|
-
<a href="#
|
379
|
+
<a href="#M000027" class="method-signature">
|
380
380
|
<span class="method-name">add_component</span><span class="method-args">(component)</span>
|
381
381
|
</a>
|
382
382
|
</div>
|
@@ -386,8 +386,8 @@ Alias for <a href="Component.html#M000026">add_component</a>
|
|
386
386
|
Add a sub-component to the current component object.
|
387
387
|
</p>
|
388
388
|
<p><a class="source-toggle" href="#"
|
389
|
-
onclick="toggleCode('
|
390
|
-
<div class="method-source-code" id="
|
389
|
+
onclick="toggleCode('M000027-source');return false;">[Source]</a></p>
|
390
|
+
<div class="method-source-code" id="M000027-source">
|
391
391
|
<pre>
|
392
392
|
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 36</span>
|
393
393
|
36: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_component</span>(<span class="ruby-identifier">component</span>)
|
@@ -404,11 +404,11 @@ Add a sub-component to the current component object.
|
|
404
404
|
</div>
|
405
405
|
</div>
|
406
406
|
|
407
|
-
<div id="method-
|
408
|
-
<a name="
|
407
|
+
<div id="method-M000033" class="method-detail">
|
408
|
+
<a name="M000033"></a>
|
409
409
|
|
410
410
|
<div class="method-heading">
|
411
|
-
<a href="#
|
411
|
+
<a href="#M000033" class="method-signature">
|
412
412
|
<span class="method-name">custom_property</span><span class="method-args">(name, value)</span>
|
413
413
|
</a>
|
414
414
|
</div>
|
@@ -418,46 +418,46 @@ Add a sub-component to the current component object.
|
|
418
418
|
TODO: Look into the x-property, x-param stuff…
|
419
419
|
</p>
|
420
420
|
<p><a class="source-toggle" href="#"
|
421
|
-
onclick="toggleCode('
|
422
|
-
<div class="method-source-code" id="
|
421
|
+
onclick="toggleCode('M000033-source');return false;">[Source]</a></p>
|
422
|
+
<div class="method-source-code" id="M000033-source">
|
423
423
|
<pre>
|
424
|
-
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line
|
425
|
-
|
426
|
-
|
427
|
-
|
424
|
+
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 119</span>
|
425
|
+
119: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">custom_property</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span>)
|
426
|
+
120: <span class="ruby-ivar">@properties</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">value</span>
|
427
|
+
121: <span class="ruby-keyword kw">end</span>
|
428
428
|
</pre>
|
429
429
|
</div>
|
430
430
|
</div>
|
431
431
|
</div>
|
432
432
|
|
433
|
-
<div id="method-
|
434
|
-
<a name="
|
433
|
+
<div id="method-M000034" class="method-detail">
|
434
|
+
<a name="M000034"></a>
|
435
435
|
|
436
436
|
<div class="method-heading">
|
437
|
-
<a href="#
|
437
|
+
<a href="#M000034" class="method-signature">
|
438
438
|
<span class="method-name">multi_property?</span><span class="method-args">(name)</span>
|
439
439
|
</a>
|
440
440
|
</div>
|
441
441
|
|
442
442
|
<div class="method-description">
|
443
443
|
<p><a class="source-toggle" href="#"
|
444
|
-
onclick="toggleCode('
|
445
|
-
<div class="method-source-code" id="
|
444
|
+
onclick="toggleCode('M000034-source');return false;">[Source]</a></p>
|
445
|
+
<div class="method-source-code" id="M000034-source">
|
446
446
|
<pre>
|
447
|
-
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line
|
448
|
-
|
449
|
-
|
450
|
-
|
447
|
+
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 123</span>
|
448
|
+
123: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">multi_property?</span>(<span class="ruby-identifier">name</span>)
|
449
|
+
124: <span class="ruby-ivar">@@multi_properties</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">name</span>.<span class="ruby-identifier">upcase</span>)
|
450
|
+
125: <span class="ruby-keyword kw">end</span>
|
451
451
|
</pre>
|
452
452
|
</div>
|
453
453
|
</div>
|
454
454
|
</div>
|
455
455
|
|
456
|
-
<div id="method-
|
457
|
-
<a name="
|
456
|
+
<div id="method-M000030" class="method-detail">
|
457
|
+
<a name="M000030"></a>
|
458
458
|
|
459
459
|
<div class="method-heading">
|
460
|
-
<a href="#
|
460
|
+
<a href="#M000030" class="method-signature">
|
461
461
|
<span class="method-name">print_component</span><span class="method-args">() {|s| ...}</span>
|
462
462
|
</a>
|
463
463
|
</div>
|
@@ -467,8 +467,8 @@ TODO: Look into the x-property, x-param stuff…
|
|
467
467
|
Print this icalendar component
|
468
468
|
</p>
|
469
469
|
<p><a class="source-toggle" href="#"
|
470
|
-
onclick="toggleCode('
|
471
|
-
<div class="method-source-code" id="
|
470
|
+
onclick="toggleCode('M000030-source');return false;">[Source]</a></p>
|
471
|
+
<div class="method-source-code" id="M000030-source">
|
472
472
|
<pre>
|
473
473
|
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 57</span>
|
474
474
|
57: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">print_component</span>
|
@@ -491,11 +491,11 @@ Print this icalendar component
|
|
491
491
|
</div>
|
492
492
|
</div>
|
493
493
|
|
494
|
-
<div id="method-
|
495
|
-
<a name="
|
494
|
+
<div id="method-M000032" class="method-detail">
|
495
|
+
<a name="M000032"></a>
|
496
496
|
|
497
497
|
<div class="method-heading">
|
498
|
-
<a href="#
|
498
|
+
<a href="#M000032" class="method-signature">
|
499
499
|
<span class="method-name">print_parameter</span><span class="method-args">(s, key, value)</span>
|
500
500
|
</a>
|
501
501
|
</div>
|
@@ -505,42 +505,42 @@ Print this icalendar component
|
|
505
505
|
Print the parameters for a specific property
|
506
506
|
</p>
|
507
507
|
<p><a class="source-toggle" href="#"
|
508
|
-
onclick="toggleCode('
|
509
|
-
<div class="method-source-code" id="
|
508
|
+
onclick="toggleCode('M000032-source');return false;">[Source]</a></p>
|
509
|
+
<div class="method-source-code" id="M000032-source">
|
510
510
|
<pre>
|
511
|
-
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
511
|
+
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 95</span>
|
512
|
+
95: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">print_parameter</span>(<span class="ruby-identifier">s</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
|
513
|
+
96: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@property_params</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">key</span>)
|
514
|
+
97: <span class="ruby-identifier">params</span> = <span class="ruby-ivar">@property_params</span>[<span class="ruby-identifier">key</span>]
|
515
|
+
98: <span class="ruby-identifier">params</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>,<span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
|
516
|
+
99: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-node">";#{key}"</span>
|
517
|
+
100: <span class="ruby-identifier">val</span> = [ <span class="ruby-identifier">val</span> ] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:to_ary</span>)
|
518
|
+
101:
|
519
|
+
102: <span class="ruby-comment cmt"># Possible parameter values</span>
|
520
|
+
103: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">empty?</span>
|
521
|
+
104: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"="</span>
|
522
|
+
105: <span class="ruby-identifier">sep</span> = <span class="ruby-value str">""</span> <span class="ruby-comment cmt"># First entry comes after = sign, but then we need commas</span>
|
523
|
+
106: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">pval</span><span class="ruby-operator">|</span>
|
524
|
+
107: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pval</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-identifier">:to_ical</span>
|
525
|
+
108: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">sep</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">pval</span>.<span class="ruby-identifier">to_ical</span>
|
526
|
+
109: <span class="ruby-identifier">sep</span> = <span class="ruby-value str">","</span>
|
527
|
+
110: <span class="ruby-keyword kw">end</span>
|
528
|
+
111: <span class="ruby-keyword kw">end</span>
|
529
|
+
112: <span class="ruby-keyword kw">end</span>
|
530
|
+
113:
|
531
|
+
114: <span class="ruby-keyword kw">end</span>
|
532
|
+
115: <span class="ruby-keyword kw">end</span>
|
533
|
+
116: <span class="ruby-keyword kw">end</span>
|
534
534
|
</pre>
|
535
535
|
</div>
|
536
536
|
</div>
|
537
537
|
</div>
|
538
538
|
|
539
|
-
<div id="method-
|
540
|
-
<a name="
|
539
|
+
<div id="method-M000031" class="method-detail">
|
540
|
+
<a name="M000031"></a>
|
541
541
|
|
542
542
|
<div class="method-heading">
|
543
|
-
<a href="#
|
543
|
+
<a href="#M000031" class="method-signature">
|
544
544
|
<span class="method-name">print_properties</span><span class="method-args">(s)</span>
|
545
545
|
</a>
|
546
546
|
</div>
|
@@ -550,73 +550,74 @@ Print the parameters for a specific property
|
|
550
550
|
Print this components properties
|
551
551
|
</p>
|
552
552
|
<p><a class="source-toggle" href="#"
|
553
|
-
onclick="toggleCode('
|
554
|
-
<div class="method-source-code" id="
|
553
|
+
onclick="toggleCode('M000031-source');return false;">[Source]</a></p>
|
554
|
+
<div class="method-source-code" id="M000031-source">
|
555
555
|
<pre>
|
556
556
|
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 74</span>
|
557
557
|
74: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">print_properties</span>(<span class="ruby-identifier">s</span>)
|
558
558
|
75: <span class="ruby-ivar">@properties</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>,<span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
559
|
-
76:
|
560
|
-
77: <span class="ruby-comment cmt">#
|
561
|
-
78: <span class="ruby-
|
562
|
-
79:
|
563
|
-
80:
|
564
|
-
81:
|
565
|
-
82:
|
566
|
-
83: <span class="ruby-
|
567
|
-
84:
|
568
|
-
85:
|
569
|
-
86: <span class="ruby-
|
570
|
-
87:
|
571
|
-
88:
|
572
|
-
89: <span class="ruby-
|
573
|
-
90:
|
574
|
-
91:
|
559
|
+
76:
|
560
|
+
77: <span class="ruby-comment cmt"># Take out underscore for property names that conflicted</span>
|
561
|
+
78: <span class="ruby-comment cmt"># with built-in words.</span>
|
562
|
+
79: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">key</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/ip_.*/</span>
|
563
|
+
80: <span class="ruby-identifier">key</span> = <span class="ruby-identifier">key</span>[<span class="ruby-value">3</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>]
|
564
|
+
81: <span class="ruby-keyword kw">end</span>
|
565
|
+
82:
|
566
|
+
83: <span class="ruby-comment cmt"># Property name</span>
|
567
|
+
84: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{key.upcase}"</span>
|
568
|
+
85:
|
569
|
+
86: <span class="ruby-comment cmt"># Possible parameters</span>
|
570
|
+
87: <span class="ruby-identifier">print_parameter</span>(<span class="ruby-identifier">s</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
|
571
|
+
88:
|
572
|
+
89: <span class="ruby-comment cmt"># Property value</span>
|
573
|
+
90: <span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-node">":#{value.to_ical}\r\n"</span>
|
574
|
+
91: <span class="ruby-keyword kw">end</span>
|
575
|
+
92: <span class="ruby-keyword kw">end</span>
|
575
576
|
</pre>
|
576
577
|
</div>
|
577
578
|
</div>
|
578
579
|
</div>
|
579
580
|
|
580
|
-
<div id="method-
|
581
|
-
<a name="
|
581
|
+
<div id="method-M000039" class="method-detail">
|
582
|
+
<a name="M000039"></a>
|
582
583
|
|
583
584
|
<div class="method-heading">
|
584
|
-
<a href="#
|
585
|
+
<a href="#M000039" class="method-signature">
|
585
586
|
<span class="method-name">respond_to?</span><span class="method-args">(method_name)</span>
|
586
587
|
</a>
|
587
588
|
</div>
|
588
589
|
|
589
590
|
<div class="method-description">
|
590
591
|
<p><a class="source-toggle" href="#"
|
591
|
-
onclick="toggleCode('
|
592
|
-
<div class="method-source-code" id="
|
592
|
+
onclick="toggleCode('M000039-source');return false;">[Source]</a></p>
|
593
|
+
<div class="method-source-code" id="M000039-source">
|
593
594
|
<pre>
|
594
|
-
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
595
|
+
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 334</span>
|
596
|
+
334: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">method_name</span>)
|
597
|
+
335: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">method_name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/x-.*/</span>
|
598
|
+
336: <span class="ruby-keyword kw">super</span>
|
599
|
+
337: <span class="ruby-keyword kw">end</span>
|
600
|
+
338:
|
601
|
+
339: <span class="ruby-keyword kw">true</span>
|
602
|
+
340: <span class="ruby-keyword kw">end</span>
|
602
603
|
</pre>
|
603
604
|
</div>
|
604
605
|
</div>
|
605
606
|
</div>
|
606
607
|
|
607
|
-
<div id="method-
|
608
|
-
<a name="
|
608
|
+
<div id="method-M000029" class="method-detail">
|
609
|
+
<a name="M000029"></a>
|
609
610
|
|
610
611
|
<div class="method-heading">
|
611
|
-
<a href="#
|
612
|
+
<a href="#M000029" class="method-signature">
|
612
613
|
<span class="method-name">to_ical</span><span class="method-args">()</span>
|
613
614
|
</a>
|
614
615
|
</div>
|
615
616
|
|
616
617
|
<div class="method-description">
|
617
618
|
<p><a class="source-toggle" href="#"
|
618
|
-
onclick="toggleCode('
|
619
|
-
<div class="method-source-code" id="
|
619
|
+
onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
|
620
|
+
<div class="method-source-code" id="M000029-source">
|
620
621
|
<pre>
|
621
622
|
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 48</span>
|
622
623
|
48: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_ical</span>
|
@@ -633,42 +634,42 @@ Print this components properties
|
|
633
634
|
|
634
635
|
<h3 class="section-bar">Protected Instance methods</h3>
|
635
636
|
|
636
|
-
<div id="method-
|
637
|
-
<a name="
|
637
|
+
<div id="method-M000038" class="method-detail">
|
638
|
+
<a name="M000038"></a>
|
638
639
|
|
639
640
|
<div class="method-heading">
|
640
|
-
<a href="#
|
641
|
+
<a href="#M000038" class="method-signature">
|
641
642
|
<span class="method-name">method_missing</span><span class="method-args">(method_name, *args)</span>
|
642
643
|
</a>
|
643
644
|
</div>
|
644
645
|
|
645
646
|
<div class="method-description">
|
646
647
|
<p><a class="source-toggle" href="#"
|
647
|
-
onclick="toggleCode('
|
648
|
-
<div class="method-source-code" id="
|
648
|
+
onclick="toggleCode('M000038-source');return false;">[Source]</a></p>
|
649
|
+
<div class="method-source-code" id="M000038-source">
|
649
650
|
<pre>
|
650
|
-
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
651
|
+
<span class="ruby-comment cmt"># File lib/icalendar/component.rb, line 310</span>
|
652
|
+
310: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">method_name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
653
|
+
311: <span class="ruby-identifier">method_name</span> = <span class="ruby-identifier">method_name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span>
|
654
|
+
312:
|
655
|
+
313: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">method_name</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/x_.*/</span>
|
656
|
+
314: <span class="ruby-identifier">raise</span> <span class="ruby-constant">NoMethodError</span>
|
657
|
+
315: <span class="ruby-keyword kw">end</span>
|
658
|
+
316:
|
659
|
+
317: <span class="ruby-identifier">val</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">first</span>
|
660
|
+
318:
|
661
|
+
319: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:to_ical</span>)
|
662
|
+
320: <span class="ruby-identifier">raise</span>(<span class="ruby-constant">NotImplementedError</span>, <span class="ruby-value str">"Value of type ("</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-value str">") does not support to_ical method!"</span>)
|
663
|
+
321: <span class="ruby-keyword kw">end</span>
|
664
|
+
322:
|
665
|
+
323: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">method_name</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/(.*)(=)/</span> <span class="ruby-comment cmt"># Its a setter</span>
|
666
|
+
324: <span class="ruby-ivar">@properties</span>[<span class="ruby-identifier">$1</span>] = <span class="ruby-identifier">val</span>
|
667
|
+
325: <span class="ruby-ivar">@@logger</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">"Setting #{$1} => #{val}"</span>)
|
668
|
+
326: <span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt"># Or its a getter</span>
|
669
|
+
327: <span class="ruby-ivar">@@logger</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">"Getting #{method_name} => #{@properties[method_name]}"</span>)
|
670
|
+
328: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@properties</span>[<span class="ruby-identifier">method_name</span>]
|
671
|
+
329: <span class="ruby-keyword kw">end</span>
|
672
|
+
330: <span class="ruby-keyword kw">end</span>
|
672
673
|
</pre>
|
673
674
|
</div>
|
674
675
|
</div>
|