sdl4r 0.9.5 → 0.9.6
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +11 -2
- data/Rakefile +1 -1
- data/TODO +9 -1
- data/doc/classes/SDL4R.html +42 -196
- data/doc/classes/SDL4R/Parser.html +45 -107
- data/doc/classes/SDL4R/SdlBinary.html +59 -119
- data/doc/classes/SDL4R/SdlParseError.html +28 -50
- data/doc/classes/SDL4R/SdlTimeSpan.html +257 -475
- data/doc/classes/SDL4R/Tag.html +497 -828
- data/doc/created.rid +1 -1
- data/doc/files/CHANGELOG.html +46 -18
- data/doc/files/LICENSE.html +51 -42
- data/doc/files/README.html +42 -32
- data/doc/files/lib/sdl4r/parser/reader_rb.html +21 -11
- data/doc/files/lib/sdl4r/parser/time_span_with_zone_rb.html +21 -11
- data/doc/files/lib/sdl4r/parser/token_rb.html +21 -11
- data/doc/files/lib/sdl4r/parser/tokenizer_rb.html +21 -11
- data/doc/files/lib/sdl4r/parser_rb.html +21 -14
- data/doc/files/lib/sdl4r/sdl4r_rb.html +23 -18
- data/doc/files/lib/sdl4r/sdl_binary_rb.html +21 -11
- data/doc/files/lib/sdl4r/sdl_parse_error_rb.html +21 -11
- data/doc/files/lib/sdl4r/sdl_time_span_rb.html +21 -11
- data/doc/files/lib/sdl4r/tag_rb.html +23 -18
- data/doc/files/lib/sdl4r_rb.html +21 -11
- data/doc/fr_class_index.html +11 -14
- data/doc/fr_file_index.html +11 -22
- data/doc/fr_method_index.html +90 -175
- data/doc/index.html +7 -4
- data/doc/rdoc-style.css +119 -210
- data/lib/sdl4r/tag.rb +23 -12
- data/test/sdl4r/tag_test.rb +53 -0
- metadata +9 -4
data/doc/classes/SDL4R/Tag.html
CHANGED
@@ -1,8 +1,11 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
3
6
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
7
|
<head>
|
5
|
-
<title>Class: SDL4R::Tag
|
8
|
+
<title>Class: SDL4R::Tag</title>
|
6
9
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
10
|
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
8
11
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
@@ -22,7 +25,7 @@
|
|
22
25
|
return false;
|
23
26
|
|
24
27
|
elemStyle = elem.style;
|
25
|
-
|
28
|
+
|
26
29
|
if ( elemStyle.display != "block" ) {
|
27
30
|
elemStyle.display = "block"
|
28
31
|
} else {
|
@@ -31,10 +34,10 @@
|
|
31
34
|
|
32
35
|
return true;
|
33
36
|
}
|
34
|
-
|
37
|
+
|
35
38
|
// Make codeblocks hidden by default
|
36
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }
|
37
|
-
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
38
41
|
// ]]>
|
39
42
|
</script>
|
40
43
|
|
@@ -42,6 +45,7 @@
|
|
42
45
|
<body>
|
43
46
|
|
44
47
|
|
48
|
+
|
45
49
|
<div id="classHeader">
|
46
50
|
<table class="header-table">
|
47
51
|
<tr class="top-aligned-row">
|
@@ -51,36 +55,27 @@
|
|
51
55
|
<tr class="top-aligned-row">
|
52
56
|
<td><strong>In:</strong></td>
|
53
57
|
<td>
|
54
|
-
|
55
|
-
|
56
58
|
<a href="../../files/lib/sdl4r/tag_rb.html">
|
57
|
-
|
58
59
|
lib/sdl4r/tag.rb
|
59
|
-
|
60
60
|
</a>
|
61
|
-
|
62
|
-
|
63
61
|
<br />
|
64
|
-
|
65
62
|
</td>
|
66
63
|
</tr>
|
67
64
|
|
68
|
-
|
69
65
|
<tr class="top-aligned-row">
|
70
66
|
<td><strong>Parent:</strong></td>
|
71
67
|
<td>
|
72
|
-
|
73
68
|
Object
|
74
|
-
|
75
69
|
</td>
|
76
70
|
</tr>
|
77
|
-
|
78
71
|
</table>
|
79
72
|
</div>
|
80
73
|
<!-- banner header -->
|
81
74
|
|
82
75
|
<div id="bodyContent">
|
83
76
|
|
77
|
+
|
78
|
+
|
84
79
|
<div id="contextContent">
|
85
80
|
|
86
81
|
<div id="description">
|
@@ -97,7 +92,7 @@ children/values/attributes/etc in this class returns copies or
|
|
97
92
|
implementations. It can be one or the other depending on the method. The
|
98
93
|
implementations are designed to be correct and somewhat efficient, not too
|
99
94
|
protect the <a href="Tag.html">Tag</a> internal state from ill-use of the
|
100
|
-
returned values
|
95
|
+
returned <a href="Tag.html#M000033">values</a>.
|
101
96
|
</p>
|
102
97
|
<h2>Authors</h2>
|
103
98
|
<p>
|
@@ -106,165 +101,111 @@ Daniel Leuck, Philippe Vosges
|
|
106
101
|
|
107
102
|
</div>
|
108
103
|
|
109
|
-
</div>
|
110
104
|
|
105
|
+
</div>
|
111
106
|
|
112
107
|
<div id="method-list">
|
113
108
|
<h3 class="section-bar">Methods</h3>
|
114
109
|
|
115
110
|
<div class="name-list">
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
<a href="#M000068">name=</a>
|
160
|
-
|
161
|
-
<a href="#M000069">namespace=</a>
|
162
|
-
|
163
|
-
<a href="#M000038">new</a>
|
164
|
-
|
165
|
-
<a href="#M000039">new_child</a>
|
166
|
-
|
167
|
-
<a href="#M000070">read</a>
|
168
|
-
|
169
|
-
<a href="#M000071">read_from_io</a>
|
170
|
-
|
171
|
-
<a href="#M000064">remove_attribute</a>
|
172
|
-
|
173
|
-
<a href="#M000042">remove_child</a>
|
174
|
-
|
175
|
-
<a href="#M000056">remove_value</a>
|
176
|
-
|
177
|
-
<a href="#M000060">set_attribute</a>
|
178
|
-
|
179
|
-
<a href="#M000066">set_attributes</a>
|
180
|
-
|
181
|
-
<a href="#M000052">to_child_hash</a>
|
182
|
-
|
183
|
-
<a href="#M000053">to_child_string_hash</a>
|
184
|
-
|
185
|
-
<a href="#M000073">to_s</a>
|
186
|
-
|
187
|
-
<a href="#M000074">to_string</a>
|
188
|
-
|
189
|
-
<a href="#M000079">to_xml_string</a>
|
190
|
-
|
191
|
-
<a href="#M000045">value</a>
|
192
|
-
|
193
|
-
<a href="#M000044">value=</a>
|
194
|
-
|
195
|
-
<a href="#M000058">values</a>
|
196
|
-
|
197
|
-
<a href="#M000059">values=</a>
|
198
|
-
|
199
|
-
<a href="#M000072">write</a>
|
200
|
-
|
111
|
+
<a href="#M000016"><<</a>
|
112
|
+
<a href="#M000052">==</a>
|
113
|
+
<a href="#M000015">add_child</a>
|
114
|
+
<a href="#M000029">add_value</a>
|
115
|
+
<a href="#M000036">attribute</a>
|
116
|
+
<a href="#M000038">attributes</a>
|
117
|
+
<a href="#M000042">attributes=</a>
|
118
|
+
<a href="#M000024">child</a>
|
119
|
+
<a href="#M000021">child_count</a>
|
120
|
+
<a href="#M000022">children</a>
|
121
|
+
<a href="#M000050">children_to_string</a>
|
122
|
+
<a href="#M000023">children_values</a>
|
123
|
+
<a href="#M000040">clear_attributes</a>
|
124
|
+
<a href="#M000018">clear_children</a>
|
125
|
+
<a href="#M000032">clear_values</a>
|
126
|
+
<a href="#M000051">eql?</a>
|
127
|
+
<a href="#M000037">has_attribute?</a>
|
128
|
+
<a href="#M000025">has_child?</a>
|
129
|
+
<a href="#M000026">has_children?</a>
|
130
|
+
<a href="#M000030">has_value?</a>
|
131
|
+
<a href="#M000053">hash</a>
|
132
|
+
<a href="#M000043">name=</a>
|
133
|
+
<a href="#M000044">namespace=</a>
|
134
|
+
<a href="#M000013">new</a>
|
135
|
+
<a href="#M000014">new_child</a>
|
136
|
+
<a href="#M000045">read</a>
|
137
|
+
<a href="#M000046">read_from_io</a>
|
138
|
+
<a href="#M000039">remove_attribute</a>
|
139
|
+
<a href="#M000017">remove_child</a>
|
140
|
+
<a href="#M000031">remove_value</a>
|
141
|
+
<a href="#M000035">set_attribute</a>
|
142
|
+
<a href="#M000041">set_attributes</a>
|
143
|
+
<a href="#M000027">to_child_hash</a>
|
144
|
+
<a href="#M000028">to_child_string_hash</a>
|
145
|
+
<a href="#M000048">to_s</a>
|
146
|
+
<a href="#M000049">to_string</a>
|
147
|
+
<a href="#M000054">to_xml_string</a>
|
148
|
+
<a href="#M000020">value</a>
|
149
|
+
<a href="#M000019">value=</a>
|
150
|
+
<a href="#M000033">values</a>
|
151
|
+
<a href="#M000034">values=</a>
|
152
|
+
<a href="#M000047">write</a>
|
201
153
|
</div>
|
202
154
|
</div>
|
203
155
|
|
204
156
|
</div>
|
205
157
|
|
158
|
+
|
206
159
|
<!-- if includes -->
|
207
160
|
|
208
161
|
<div id="section">
|
209
162
|
|
210
163
|
|
211
164
|
|
165
|
+
|
166
|
+
|
212
167
|
<div id="attribute-list">
|
213
168
|
<h3 class="section-bar">Attributes</h3>
|
214
169
|
|
215
170
|
<div class="name-list">
|
216
171
|
<table>
|
217
|
-
|
218
172
|
<tr class="top-aligned-row context-row">
|
219
173
|
<td class="context-item-name">name</td>
|
220
|
-
|
221
174
|
<td class="context-item-value"> [R] </td>
|
222
|
-
|
223
175
|
<td class="context-item-desc">
|
224
176
|
the name of this <a href="Tag.html">Tag</a>
|
225
177
|
|
226
178
|
</td>
|
227
179
|
</tr>
|
228
|
-
|
229
180
|
<tr class="top-aligned-row context-row">
|
230
181
|
<td class="context-item-name">namespace</td>
|
231
|
-
|
232
182
|
<td class="context-item-value"> [R] </td>
|
233
|
-
|
234
183
|
<td class="context-item-desc">
|
235
184
|
the namespace of this <a href="Tag.html">Tag</a> or an empty string when
|
236
185
|
there is no namespace (i.e. default namespace).
|
237
186
|
|
238
187
|
</td>
|
239
188
|
</tr>
|
240
|
-
|
241
189
|
</table>
|
242
190
|
</div>
|
243
191
|
</div>
|
192
|
+
|
244
193
|
|
245
194
|
|
246
195
|
<!-- if method_list -->
|
247
|
-
|
248
196
|
<div id="methods">
|
249
|
-
|
250
197
|
<h3 class="section-bar">Public Class methods</h3>
|
251
198
|
|
252
|
-
|
253
|
-
|
254
|
-
<a name="M000038"></a>
|
199
|
+
<div id="method-M000013" class="method-detail">
|
200
|
+
<a name="M000013"></a>
|
255
201
|
|
256
202
|
<div class="method-heading">
|
257
|
-
|
258
|
-
<a href="#M000038" class="method-signature">
|
259
|
-
|
203
|
+
<a href="#M000013" class="method-signature">
|
260
204
|
<span class="method-name">new</span><span class="method-args">(namespace, name = nil, &block)</span>
|
261
|
-
|
262
205
|
</a>
|
263
|
-
|
264
206
|
</div>
|
265
|
-
|
207
|
+
|
266
208
|
<div class="method-description">
|
267
|
-
|
268
209
|
<p>
|
269
210
|
Creates an empty tag in the given namespace. If the <tt>namespace</tt> is
|
270
211
|
nil it will be coerced to an empty String.
|
@@ -294,10 +235,9 @@ ArgumentError if the name is not a legal SDL identifier (see <a
|
|
294
235
|
href="../SDL4R.html#M000005">SDL4R#validate_identifier</a>) or the
|
295
236
|
namespace is non-blank and is not a legal SDL identifier.
|
296
237
|
</p>
|
297
|
-
|
298
238
|
<p><a class="source-toggle" href="#"
|
299
|
-
onclick="toggleCode('
|
300
|
-
<div class="method-source-code" id="
|
239
|
+
onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
|
240
|
+
<div class="method-source-code" id="M000013-source">
|
301
241
|
<pre>
|
302
242
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 95</span>
|
303
243
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">namespace</span>, <span class="ruby-identifier">name</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
@@ -325,36 +265,30 @@ namespace is non-blank and is not a legal SDL identifier.
|
|
325
265
|
<span class="ruby-keyword kw">end</span>
|
326
266
|
</pre>
|
327
267
|
</div>
|
328
|
-
|
329
268
|
</div>
|
330
269
|
</div>
|
331
270
|
|
332
|
-
|
333
271
|
<h3 class="section-bar">Public Instance methods</h3>
|
334
272
|
|
335
|
-
|
336
|
-
|
337
|
-
<a name="M000041"></a>
|
273
|
+
<div id="method-M000016" class="method-detail">
|
274
|
+
<a name="M000016"></a>
|
338
275
|
|
339
276
|
<div class="method-heading">
|
340
|
-
|
341
|
-
<a href="#M000041" class="method-signature">
|
342
|
-
|
277
|
+
<a href="#M000016" class="method-signature">
|
343
278
|
<span class="method-name"><<</span><span class="method-args">(o)</span>
|
344
|
-
|
345
279
|
</a>
|
346
|
-
|
347
280
|
</div>
|
348
|
-
|
281
|
+
|
349
282
|
<div class="method-description">
|
350
|
-
|
351
283
|
<p>
|
352
|
-
Adds the given object as a child if it is a
|
353
|
-
|
354
|
-
|
355
|
-
href="Tag.html">
|
356
|
-
|
357
|
-
|
284
|
+
Adds the given object as a <a href="Tag.html#M000024">child</a> if it is a
|
285
|
+
<tt><a href="Tag.html">Tag</a></tt>, as an <a
|
286
|
+
href="Tag.html#M000036">attribute</a> if it is a Hash {key => <a
|
287
|
+
href="Tag.html#M000020">value</a>} (supports namespaces), or as a <a
|
288
|
+
href="Tag.html#M000020">value</a> otherwise. If it is an array, each of its
|
289
|
+
elements is added to this <a href="Tag.html">Tag</a> via this operator. If
|
290
|
+
any of its elements is itself an array, then an anonymous tag is created
|
291
|
+
and the array is passed to it via this operator (see the examples below)
|
358
292
|
</p>
|
359
293
|
<pre>
|
360
294
|
tag << Tag.new("child")
|
@@ -373,12 +307,11 @@ via this operator (see the examples below)
|
|
373
307
|
Returns <tt>self</tt>.
|
374
308
|
</p>
|
375
309
|
<p>
|
376
|
-
Use other accessors for a stricter and less
|
310
|
+
Use other accessors for a stricter and less "magical" behavior.
|
377
311
|
</p>
|
378
|
-
|
379
312
|
<p><a class="source-toggle" href="#"
|
380
|
-
onclick="toggleCode('
|
381
|
-
<div class="method-source-code" id="
|
313
|
+
onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
|
314
|
+
<div class="method-source-code" id="M000016-source">
|
382
315
|
<pre>
|
383
316
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 169</span>
|
384
317
|
<span class="ruby-keyword kw">def</span> <span class="ruby-operator"><<</span>(<span class="ruby-identifier">o</span>)
|
@@ -406,60 +339,48 @@ Use other accessors for a stricter and less “magical” behavior.
|
|
406
339
|
<span class="ruby-keyword kw">end</span>
|
407
340
|
</pre>
|
408
341
|
</div>
|
409
|
-
|
410
342
|
</div>
|
411
343
|
</div>
|
412
344
|
|
413
|
-
|
414
|
-
|
415
|
-
<a name="M000077"></a>
|
345
|
+
<div id="method-M000052" class="method-detail">
|
346
|
+
<a name="M000052"></a>
|
416
347
|
|
417
348
|
<div class="method-heading">
|
418
|
-
|
419
349
|
<span class="method-name">==</span><span class="method-args">(o)</span>
|
420
|
-
|
421
350
|
</div>
|
422
|
-
|
351
|
+
|
423
352
|
<div class="method-description">
|
424
|
-
|
425
353
|
<p>
|
426
|
-
Alias for
|
354
|
+
Alias for eql?
|
427
355
|
</p>
|
428
|
-
|
429
356
|
</div>
|
430
357
|
</div>
|
431
358
|
|
432
|
-
|
433
|
-
|
434
|
-
<a name="M000040"></a>
|
359
|
+
<div id="method-M000015" class="method-detail">
|
360
|
+
<a name="M000015"></a>
|
435
361
|
|
436
362
|
<div class="method-heading">
|
437
|
-
|
438
|
-
<a href="#M000040" class="method-signature">
|
439
|
-
|
363
|
+
<a href="#M000015" class="method-signature">
|
440
364
|
<span class="method-name">add_child</span><span class="method-args">(child)</span>
|
441
|
-
|
442
365
|
</a>
|
443
|
-
|
444
366
|
</div>
|
445
|
-
|
367
|
+
|
446
368
|
<div class="method-description">
|
447
|
-
|
448
369
|
<p>
|
449
|
-
Add a
|
370
|
+
Add a <a href="Tag.html#M000024">child</a> to this <a
|
371
|
+
href="Tag.html">Tag</a>.
|
450
372
|
</p>
|
451
373
|
<table>
|
452
|
-
<tr><td valign="top"><tt>child</tt>:</td><td>The child to add
|
374
|
+
<tr><td valign="top"><tt><a href="Tag.html#M000024">child</a></tt>:</td><td>The <a href="Tag.html#M000024">child</a> to add
|
453
375
|
|
454
376
|
</td></tr>
|
455
377
|
</table>
|
456
378
|
<p>
|
457
|
-
Returns the added child
|
379
|
+
Returns the added <a href="Tag.html#M000024">child</a>.
|
458
380
|
</p>
|
459
|
-
|
460
381
|
<p><a class="source-toggle" href="#"
|
461
|
-
onclick="toggleCode('
|
462
|
-
<div class="method-source-code" id="
|
382
|
+
onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
|
383
|
+
<div class="method-source-code" id="M000015-source">
|
463
384
|
<pre>
|
464
385
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 142</span>
|
465
386
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_child</span>(<span class="ruby-identifier">child</span>)
|
@@ -468,43 +389,37 @@ Returns the added child.
|
|
468
389
|
<span class="ruby-keyword kw">end</span>
|
469
390
|
</pre>
|
470
391
|
</div>
|
471
|
-
|
472
392
|
</div>
|
473
393
|
</div>
|
474
394
|
|
475
|
-
|
476
|
-
|
477
|
-
<a name="M000054"></a>
|
395
|
+
<div id="method-M000029" class="method-detail">
|
396
|
+
<a name="M000029"></a>
|
478
397
|
|
479
398
|
<div class="method-heading">
|
480
|
-
|
481
|
-
<a href="#M000054" class="method-signature">
|
482
|
-
|
399
|
+
<a href="#M000029" class="method-signature">
|
483
400
|
<span class="method-name">add_value</span><span class="method-args">(v)</span>
|
484
|
-
|
485
401
|
</a>
|
486
|
-
|
487
402
|
</div>
|
488
|
-
|
403
|
+
|
489
404
|
<div class="method-description">
|
490
|
-
|
491
405
|
<p>
|
492
|
-
Adds a
|
406
|
+
Adds a <a href="Tag.html#M000020">value</a> to this <a
|
407
|
+
href="Tag.html">Tag</a>. See <a
|
493
408
|
href="../SDL4R.html#M000004">SDL4R#coerce_or_fail</a> to know about the
|
494
409
|
allowable types.
|
495
410
|
</p>
|
496
411
|
<table>
|
497
|
-
<tr><td valign="top"><tt>v</tt>:</td><td>The value to add
|
412
|
+
<tr><td valign="top"><tt>v</tt>:</td><td>The <a href="Tag.html#M000020">value</a> to add
|
498
413
|
|
499
414
|
</td></tr>
|
500
415
|
</table>
|
501
416
|
<p>
|
502
|
-
Raises an <tt>ArgumentError</tt> if the
|
417
|
+
Raises an <tt>ArgumentError</tt> if the <a
|
418
|
+
href="Tag.html#M000020">value</a> is not a legal SDL type
|
503
419
|
</p>
|
504
|
-
|
505
420
|
<p><a class="source-toggle" href="#"
|
506
|
-
onclick="toggleCode('
|
507
|
-
<div class="method-source-code" id="
|
421
|
+
onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
|
422
|
+
<div class="method-source-code" id="M000029-source">
|
508
423
|
<pre>
|
509
424
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 409</span>
|
510
425
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_value</span>(<span class="ruby-identifier">v</span>)
|
@@ -513,38 +428,30 @@ Raises an <tt>ArgumentError</tt> if the value is not a legal SDL type
|
|
513
428
|
<span class="ruby-keyword kw">end</span>
|
514
429
|
</pre>
|
515
430
|
</div>
|
516
|
-
|
517
431
|
</div>
|
518
432
|
</div>
|
519
433
|
|
520
|
-
|
521
|
-
|
522
|
-
<a name="M000061"></a>
|
434
|
+
<div id="method-M000036" class="method-detail">
|
435
|
+
<a name="M000036"></a>
|
523
436
|
|
524
437
|
<div class="method-heading">
|
525
|
-
|
526
|
-
<a href="#M000061" class="method-signature">
|
527
|
-
|
438
|
+
<a href="#M000036" class="method-signature">
|
528
439
|
<span class="method-name">attribute</span><span class="method-args">(namespace, key = nil)</span>
|
529
|
-
|
530
440
|
</a>
|
531
|
-
|
532
441
|
</div>
|
533
|
-
|
442
|
+
|
534
443
|
<div class="method-description">
|
535
|
-
|
536
444
|
<pre>
|
537
445
|
attribute(key)
|
538
446
|
attribute(namespace, key)
|
539
447
|
</pre>
|
540
448
|
<p>
|
541
|
-
Returns the
|
542
|
-
<tt>key</tt> or <tt>nil</tt> if not found.
|
449
|
+
Returns the <a href="Tag.html#M000036">attribute</a> of the specified
|
450
|
+
<tt>namespace</tt> of specified <tt>key</tt> or <tt>nil</tt> if not found.
|
543
451
|
</p>
|
544
|
-
|
545
452
|
<p><a class="source-toggle" href="#"
|
546
|
-
onclick="toggleCode('
|
547
|
-
<div class="method-source-code" id="
|
453
|
+
onclick="toggleCode('M000036-source');return false;">[Source]</a></p>
|
454
|
+
<div class="method-source-code" id="M000036-source">
|
548
455
|
<pre>
|
549
456
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 518</span>
|
550
457
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">attribute</span>(<span class="ruby-identifier">namespace</span>, <span class="ruby-identifier">key</span> = <span class="ruby-keyword kw">nil</span>)
|
@@ -554,29 +461,22 @@ Returns the attribute of the specified <tt>namespace</tt> of specified
|
|
554
461
|
<span class="ruby-keyword kw">end</span>
|
555
462
|
</pre>
|
556
463
|
</div>
|
557
|
-
|
558
464
|
</div>
|
559
465
|
</div>
|
560
466
|
|
561
|
-
|
562
|
-
|
563
|
-
<a name="M000063"></a>
|
467
|
+
<div id="method-M000038" class="method-detail">
|
468
|
+
<a name="M000038"></a>
|
564
469
|
|
565
470
|
<div class="method-heading">
|
566
|
-
|
567
|
-
<a href="#M000063" class="method-signature">
|
568
|
-
|
471
|
+
<a href="#M000038" class="method-signature">
|
569
472
|
<span class="method-name">attributes</span><span class="method-args">(namespace = nil) {|namespace, key, value| ...}</span>
|
570
|
-
|
571
473
|
</a>
|
572
|
-
|
573
474
|
</div>
|
574
|
-
|
475
|
+
|
575
476
|
<div class="method-description">
|
576
|
-
|
577
477
|
<p>
|
578
|
-
Returns a Hash of the attributes of the
|
579
|
-
(default is all) or enumerates them.
|
478
|
+
Returns a Hash of the <a href="Tag.html#M000038">attributes</a> of the
|
479
|
+
specified <tt>namespace</tt> (default is all) or enumerates them.
|
580
480
|
</p>
|
581
481
|
<pre>
|
582
482
|
tag.attributes # => { "length" => 123, "width" = 25.4, "orig:color" => "gray" }
|
@@ -585,15 +485,16 @@ Returns a Hash of the attributes of the specified <tt>namespace</tt>
|
|
585
485
|
end
|
586
486
|
</pre>
|
587
487
|
<p>
|
588
|
-
<tt>namespace</tt>:: namespace of the returned
|
589
|
-
attributes
|
590
|
-
|
591
|
-
|
488
|
+
<tt>namespace</tt>:: namespace of the returned <a
|
489
|
+
href="Tag.html#M000038">attributes</a>. If nil, all <a
|
490
|
+
href="Tag.html#M000038">attributes</a> are returned with qualified names
|
491
|
+
(e.g. "meat:color"). If "", <a
|
492
|
+
href="Tag.html#M000038">attributes</a> of the default namespace are
|
493
|
+
returned.
|
592
494
|
</p>
|
593
|
-
|
594
495
|
<p><a class="source-toggle" href="#"
|
595
|
-
onclick="toggleCode('
|
596
|
-
<div class="method-source-code" id="
|
496
|
+
onclick="toggleCode('M000038-source');return false;">[Source]</a></p>
|
497
|
+
<div class="method-source-code" id="M000038-source">
|
597
498
|
<pre>
|
598
499
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 556</span>
|
599
500
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">attributes</span>(<span class="ruby-identifier">namespace</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>) <span class="ruby-comment cmt"># :yields: namespace, key, value</span>
|
@@ -618,37 +519,29 @@ namespace are returned.
|
|
618
519
|
<span class="ruby-keyword kw">end</span>
|
619
520
|
</pre>
|
620
521
|
</div>
|
621
|
-
|
622
522
|
</div>
|
623
523
|
</div>
|
624
524
|
|
625
|
-
|
626
|
-
|
627
|
-
<a name="M000067"></a>
|
525
|
+
<div id="method-M000042" class="method-detail">
|
526
|
+
<a name="M000042"></a>
|
628
527
|
|
629
528
|
<div class="method-heading">
|
630
|
-
|
631
|
-
<a href="#M000067" class="method-signature">
|
632
|
-
|
529
|
+
<a href="#M000042" class="method-signature">
|
633
530
|
<span class="method-name">attributes=</span><span class="method-args">(attribute_hash)</span>
|
634
|
-
|
635
531
|
</a>
|
636
|
-
|
637
532
|
</div>
|
638
|
-
|
533
|
+
|
639
534
|
<div class="method-description">
|
640
|
-
|
641
535
|
<p>
|
642
|
-
Sets all the attributes of the default
|
643
|
-
href="Tag.html">Tag</a> in one operation.
|
536
|
+
Sets all the <a href="Tag.html#M000038">attributes</a> of the default
|
537
|
+
namespace for this <a href="Tag.html">Tag</a> in one operation.
|
644
538
|
</p>
|
645
539
|
<p>
|
646
|
-
See <a href="Tag.html#
|
540
|
+
See <a href="Tag.html#M000041">set_attributes</a>
|
647
541
|
</p>
|
648
|
-
|
649
542
|
<p><a class="source-toggle" href="#"
|
650
|
-
onclick="toggleCode('
|
651
|
-
<div class="method-source-code" id="
|
543
|
+
onclick="toggleCode('M000042-source');return false;">[Source]</a></p>
|
544
|
+
<div class="method-source-code" id="M000042-source">
|
652
545
|
<pre>
|
653
546
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 660</span>
|
654
547
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">attributes=</span>(<span class="ruby-identifier">attribute_hash</span>)
|
@@ -656,52 +549,45 @@ See <a href="Tag.html#M000066">set_attributes</a>
|
|
656
549
|
<span class="ruby-keyword kw">end</span>
|
657
550
|
</pre>
|
658
551
|
</div>
|
659
|
-
|
660
552
|
</div>
|
661
553
|
</div>
|
662
554
|
|
663
|
-
|
664
|
-
|
665
|
-
<a name="M000049"></a>
|
555
|
+
<div id="method-M000024" class="method-detail">
|
556
|
+
<a name="M000024"></a>
|
666
557
|
|
667
558
|
<div class="method-heading">
|
668
|
-
|
669
|
-
<a href="#M000049" class="method-signature">
|
670
|
-
|
559
|
+
<a href="#M000024" class="method-signature">
|
671
560
|
<span class="method-name">child</span><span class="method-args">(recursive = false, name = nil)</span>
|
672
|
-
|
673
561
|
</a>
|
674
|
-
|
675
562
|
</div>
|
676
|
-
|
563
|
+
|
677
564
|
<div class="method-description">
|
678
|
-
|
679
565
|
<pre>
|
680
566
|
child
|
681
567
|
child(name)
|
682
568
|
child(recursive, name)
|
683
569
|
</pre>
|
684
570
|
<p>
|
685
|
-
Get the first child with the given name,
|
686
|
-
search.
|
571
|
+
Get the first <a href="Tag.html#M000024">child</a> with the given name,
|
572
|
+
optionally using a recursive search.
|
687
573
|
</p>
|
688
574
|
<table>
|
689
|
-
<tr><td valign="top"><tt>name</tt>:</td><td>the name of the
|
690
|
-
|
575
|
+
<tr><td valign="top"><tt>name</tt>:</td><td>the name of the <a href="Tag.html#M000024">child</a> <a
|
576
|
+
href="Tag.html">Tag</a>. If <tt>nil</tt>, the first <a
|
577
|
+
href="Tag.html#M000024">child</a> is returned (<tt>nil</tt> if there are
|
691
578
|
|
692
579
|
</td></tr>
|
693
580
|
</table>
|
694
581
|
<p>
|
695
|
-
no children at all).
|
582
|
+
no <a href="Tag.html#M000022">children</a> at all).
|
696
583
|
</p>
|
697
584
|
<p>
|
698
|
-
Returns the first child tag having the given
|
699
|
-
such child exists
|
585
|
+
Returns the first <a href="Tag.html#M000024">child</a> tag having the given
|
586
|
+
name or <tt>nil</tt> if no such <a href="Tag.html#M000024">child</a> exists
|
700
587
|
</p>
|
701
|
-
|
702
588
|
<p><a class="source-toggle" href="#"
|
703
|
-
onclick="toggleCode('
|
704
|
-
<div class="method-source-code" id="
|
589
|
+
onclick="toggleCode('M000024-source');return false;">[Source]</a></p>
|
590
|
+
<div class="method-source-code" id="M000024-source">
|
705
591
|
<pre>
|
706
592
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 313</span>
|
707
593
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">child</span>(<span class="ruby-identifier">recursive</span> = <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">name</span> = <span class="ruby-keyword kw">nil</span>)
|
@@ -718,33 +604,26 @@ such child exists
|
|
718
604
|
<span class="ruby-keyword kw">end</span>
|
719
605
|
</pre>
|
720
606
|
</div>
|
721
|
-
|
722
607
|
</div>
|
723
608
|
</div>
|
724
609
|
|
725
|
-
|
726
|
-
|
727
|
-
<a name="M000046"></a>
|
610
|
+
<div id="method-M000021" class="method-detail">
|
611
|
+
<a name="M000021"></a>
|
728
612
|
|
729
613
|
<div class="method-heading">
|
730
|
-
|
731
|
-
<a href="#M000046" class="method-signature">
|
732
|
-
|
614
|
+
<a href="#M000021" class="method-signature">
|
733
615
|
<span class="method-name">child_count</span><span class="method-args">()</span>
|
734
|
-
|
735
616
|
</a>
|
736
|
-
|
737
617
|
</div>
|
738
|
-
|
618
|
+
|
739
619
|
<div class="method-description">
|
740
|
-
|
741
620
|
<p>
|
742
|
-
Returns the number of
|
621
|
+
Returns the number of <a href="Tag.html#M000022">children</a> <a
|
622
|
+
href="Tag.html">Tag</a>.
|
743
623
|
</p>
|
744
|
-
|
745
624
|
<p><a class="source-toggle" href="#"
|
746
|
-
onclick="toggleCode('
|
747
|
-
<div class="method-source-code" id="
|
625
|
+
onclick="toggleCode('M000021-source');return false;">[Source]</a></p>
|
626
|
+
<div class="method-source-code" id="M000021-source">
|
748
627
|
<pre>
|
749
628
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 234</span>
|
750
629
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">child_count</span>
|
@@ -752,26 +631,19 @@ Returns the number of children <a href="Tag.html">Tag</a>.
|
|
752
631
|
<span class="ruby-keyword kw">end</span>
|
753
632
|
</pre>
|
754
633
|
</div>
|
755
|
-
|
756
634
|
</div>
|
757
635
|
</div>
|
758
636
|
|
759
|
-
|
760
|
-
|
761
|
-
<a name="M000047"></a>
|
637
|
+
<div id="method-M000022" class="method-detail">
|
638
|
+
<a name="M000022"></a>
|
762
639
|
|
763
640
|
<div class="method-heading">
|
764
|
-
|
765
|
-
<a href="#M000047" class="method-signature">
|
766
|
-
|
641
|
+
<a href="#M000022" class="method-signature">
|
767
642
|
<span class="method-name">children</span><span class="method-args">(recursive = false, namespace = nil, name = :DEFAULT) {|child| ...}</span>
|
768
|
-
|
769
643
|
</a>
|
770
|
-
|
771
644
|
</div>
|
772
|
-
|
645
|
+
|
773
646
|
<div class="method-description">
|
774
|
-
|
775
647
|
<pre>
|
776
648
|
children(recursive)
|
777
649
|
children(recursive, name)
|
@@ -782,18 +654,19 @@ Returns the number of children <a href="Tag.html">Tag</a>.
|
|
782
654
|
children(recursive, namespace, name) { |child| ... }
|
783
655
|
</pre>
|
784
656
|
<p>
|
785
|
-
Returns an Array of the
|
786
|
-
enumerates them.
|
657
|
+
Returns an Array of the <a href="Tag.html#M000022">children</a> Tags of
|
658
|
+
this <a href="Tag.html">Tag</a> or enumerates them.
|
787
659
|
</p>
|
788
660
|
<table>
|
789
|
-
<tr><td valign="top"><tt>recursive</tt>:</td><td>if true children and all descendants will be
|
661
|
+
<tr><td valign="top"><tt>recursive</tt>:</td><td>if true <a href="Tag.html#M000022">children</a> and all descendants will be
|
662
|
+
returned. False by default.
|
790
663
|
|
791
664
|
</td></tr>
|
792
|
-
<tr><td valign="top"><tt>name</tt>:</td><td>if not nil, only children having this name
|
793
|
-
default.
|
665
|
+
<tr><td valign="top"><tt>name</tt>:</td><td>if not nil, only <a href="Tag.html#M000022">children</a> having this name
|
666
|
+
will be returned. Nil by default.
|
794
667
|
|
795
668
|
</td></tr>
|
796
|
-
<tr><td valign="top"><tt>namespace</tt>:</td><td>use nil for all namespaces and
|
669
|
+
<tr><td valign="top"><tt>namespace</tt>:</td><td>use nil for all namespaces and "" for the default one. Nil by
|
797
670
|
default.
|
798
671
|
|
799
672
|
</td></tr>
|
@@ -805,10 +678,9 @@ default.
|
|
805
678
|
tag.children(false, "name") # => children of name "name"
|
806
679
|
tag.children(false, "ns", nil) # => children of namespace "ns"
|
807
680
|
</pre>
|
808
|
-
|
809
681
|
<p><a class="source-toggle" href="#"
|
810
|
-
onclick="toggleCode('
|
811
|
-
<div class="method-source-code" id="
|
682
|
+
onclick="toggleCode('M000022-source');return false;">[Source]</a></p>
|
683
|
+
<div class="method-source-code" id="M000022-source">
|
812
684
|
<pre>
|
813
685
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 258</span>
|
814
686
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">children</span>(<span class="ruby-identifier">recursive</span> = <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">namespace</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">name</span> = <span class="ruby-identifier">:DEFAULT</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>) <span class="ruby-comment cmt"># :yields: child</span>
|
@@ -836,28 +708,22 @@ default.
|
|
836
708
|
<span class="ruby-keyword kw">end</span>
|
837
709
|
</pre>
|
838
710
|
</div>
|
839
|
-
|
840
711
|
</div>
|
841
712
|
</div>
|
842
713
|
|
843
|
-
|
844
|
-
|
845
|
-
<a name="M000075"></a>
|
714
|
+
<div id="method-M000050" class="method-detail">
|
715
|
+
<a name="M000050"></a>
|
846
716
|
|
847
717
|
<div class="method-heading">
|
848
|
-
|
849
|
-
<a href="#M000075" class="method-signature">
|
850
|
-
|
718
|
+
<a href="#M000050" class="method-signature">
|
851
719
|
<span class="method-name">children_to_string</span><span class="method-args">(line_prefix = "", s = "")</span>
|
852
|
-
|
853
720
|
</a>
|
854
|
-
|
855
721
|
</div>
|
856
|
-
|
722
|
+
|
857
723
|
<div class="method-description">
|
858
|
-
|
859
724
|
<p>
|
860
|
-
Returns a string representation of the
|
725
|
+
Returns a string representation of the <a
|
726
|
+
href="Tag.html#M000022">children</a> tags.
|
861
727
|
</p>
|
862
728
|
<table>
|
863
729
|
<tr><td valign="top"><tt>linePrefix</tt>:</td><td>A prefix to insert before every line.
|
@@ -870,12 +736,11 @@ Returns a string representation of the children tags.
|
|
870
736
|
<p>
|
871
737
|
TODO: break up long lines using the backslash
|
872
738
|
</p>
|
873
|
-
|
874
739
|
<p><a class="source-toggle" href="#"
|
875
|
-
onclick="toggleCode('
|
876
|
-
<div class="method-source-code" id="
|
740
|
+
onclick="toggleCode('M000050-source');return false;">[Source]</a></p>
|
741
|
+
<div class="method-source-code" id="M000050-source">
|
877
742
|
<pre>
|
878
|
-
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line
|
743
|
+
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 833</span>
|
879
744
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">children_to_string</span>(<span class="ruby-identifier">line_prefix</span> = <span class="ruby-value str">""</span>, <span class="ruby-identifier">s</span> = <span class="ruby-value str">""</span>)
|
880
745
|
<span class="ruby-ivar">@children</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">child</span><span class="ruby-operator">|</span>
|
881
746
|
<span class="ruby-identifier">s</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">child</span>.<span class="ruby-identifier">to_string</span>(<span class="ruby-identifier">line_prefix</span>) <span class="ruby-operator"><<</span> <span class="ruby-identifier">$/</span>
|
@@ -885,41 +750,38 @@ TODO: break up long lines using the backslash
|
|
885
750
|
<span class="ruby-keyword kw">end</span>
|
886
751
|
</pre>
|
887
752
|
</div>
|
888
|
-
|
889
753
|
</div>
|
890
754
|
</div>
|
891
755
|
|
892
|
-
|
893
|
-
|
894
|
-
<a name="M000048"></a>
|
756
|
+
<div id="method-M000023" class="method-detail">
|
757
|
+
<a name="M000023"></a>
|
895
758
|
|
896
759
|
<div class="method-heading">
|
897
|
-
|
898
|
-
<a href="#M000048" class="method-signature">
|
899
|
-
|
760
|
+
<a href="#M000023" class="method-signature">
|
900
761
|
<span class="method-name">children_values</span><span class="method-args">(name = nil)</span>
|
901
|
-
|
902
762
|
</a>
|
903
|
-
|
904
763
|
</div>
|
905
|
-
|
764
|
+
|
906
765
|
<div class="method-description">
|
907
|
-
|
908
766
|
<p>
|
909
|
-
Returns the values of all the
|
910
|
-
|
911
|
-
|
912
|
-
|
767
|
+
Returns the <a href="Tag.html#M000033">values</a> of all the <a
|
768
|
+
href="Tag.html#M000022">children</a> with the given <tt>name</tt>. If the
|
769
|
+
<a href="Tag.html#M000024">child</a> has more than one <a
|
770
|
+
href="Tag.html#M000020">value</a>, all the <a
|
771
|
+
href="Tag.html#M000033">values</a> will be added as an array. If the <a
|
772
|
+
href="Tag.html#M000024">child</a> has no <a
|
773
|
+
href="Tag.html#M000020">value</a>, <tt>nil</tt> will be added. The search
|
774
|
+
is not recursive.
|
913
775
|
</p>
|
914
776
|
<table>
|
915
|
-
<tr><td valign="top"><tt>name</tt>:</td><td>if nil, all children are considered (nil by
|
777
|
+
<tr><td valign="top"><tt>name</tt>:</td><td>if nil, all <a href="Tag.html#M000022">children</a> are considered (nil by
|
778
|
+
default).
|
916
779
|
|
917
780
|
</td></tr>
|
918
781
|
</table>
|
919
|
-
|
920
782
|
<p><a class="source-toggle" href="#"
|
921
|
-
onclick="toggleCode('
|
922
|
-
<div class="method-source-code" id="
|
783
|
+
onclick="toggleCode('M000023-source');return false;">[Source]</a></p>
|
784
|
+
<div class="method-source-code" id="M000023-source">
|
923
785
|
<pre>
|
924
786
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 287</span>
|
925
787
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">children_values</span>(<span class="ruby-identifier">name</span> = <span class="ruby-keyword kw">nil</span>)
|
@@ -938,34 +800,27 @@ recursive.
|
|
938
800
|
<span class="ruby-keyword kw">end</span>
|
939
801
|
</pre>
|
940
802
|
</div>
|
941
|
-
|
942
803
|
</div>
|
943
804
|
</div>
|
944
805
|
|
945
|
-
|
946
|
-
|
947
|
-
<a name="M000065"></a>
|
806
|
+
<div id="method-M000040" class="method-detail">
|
807
|
+
<a name="M000040"></a>
|
948
808
|
|
949
809
|
<div class="method-heading">
|
950
|
-
|
951
|
-
<a href="#M000065" class="method-signature">
|
952
|
-
|
810
|
+
<a href="#M000040" class="method-signature">
|
953
811
|
<span class="method-name">clear_attributes</span><span class="method-args">(namespace = nil)</span>
|
954
|
-
|
955
812
|
</a>
|
956
|
-
|
957
813
|
</div>
|
958
|
-
|
814
|
+
|
959
815
|
<div class="method-description">
|
960
|
-
|
961
816
|
<p>
|
962
|
-
Clears the attributes of the specified
|
817
|
+
Clears the <a href="Tag.html#M000038">attributes</a> of the specified
|
818
|
+
namespace or all the <a href="Tag.html#M000038">attributes</a> if
|
963
819
|
<tt>namespace</tt> is <tt>nil</tt>.
|
964
820
|
</p>
|
965
|
-
|
966
821
|
<p><a class="source-toggle" href="#"
|
967
|
-
onclick="toggleCode('
|
968
|
-
<div class="method-source-code" id="
|
822
|
+
onclick="toggleCode('M000040-source');return false;">[Source]</a></p>
|
823
|
+
<div class="method-source-code" id="M000040-source">
|
969
824
|
<pre>
|
970
825
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 596</span>
|
971
826
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clear_attributes</span>(<span class="ruby-identifier">namespace</span> = <span class="ruby-keyword kw">nil</span>)
|
@@ -977,33 +832,25 @@ Clears the attributes of the specified namespace or all the attributes if
|
|
977
832
|
<span class="ruby-keyword kw">end</span>
|
978
833
|
</pre>
|
979
834
|
</div>
|
980
|
-
|
981
835
|
</div>
|
982
836
|
</div>
|
983
837
|
|
984
|
-
|
985
|
-
|
986
|
-
<a name="M000043"></a>
|
838
|
+
<div id="method-M000018" class="method-detail">
|
839
|
+
<a name="M000018"></a>
|
987
840
|
|
988
841
|
<div class="method-heading">
|
989
|
-
|
990
|
-
<a href="#M000043" class="method-signature">
|
991
|
-
|
842
|
+
<a href="#M000018" class="method-signature">
|
992
843
|
<span class="method-name">clear_children</span><span class="method-args">()</span>
|
993
|
-
|
994
844
|
</a>
|
995
|
-
|
996
845
|
</div>
|
997
|
-
|
846
|
+
|
998
847
|
<div class="method-description">
|
999
|
-
|
1000
848
|
<p>
|
1001
|
-
Removes all children
|
849
|
+
Removes all <a href="Tag.html#M000022">children</a>.
|
1002
850
|
</p>
|
1003
|
-
|
1004
851
|
<p><a class="source-toggle" href="#"
|
1005
|
-
onclick="toggleCode('
|
1006
|
-
<div class="method-source-code" id="
|
852
|
+
onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
|
853
|
+
<div class="method-source-code" id="M000018-source">
|
1007
854
|
<pre>
|
1008
855
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 205</span>
|
1009
856
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clear_children</span>
|
@@ -1012,33 +859,25 @@ Removes all children.
|
|
1012
859
|
<span class="ruby-keyword kw">end</span>
|
1013
860
|
</pre>
|
1014
861
|
</div>
|
1015
|
-
|
1016
862
|
</div>
|
1017
863
|
</div>
|
1018
864
|
|
1019
|
-
|
1020
|
-
|
1021
|
-
<a name="M000057"></a>
|
865
|
+
<div id="method-M000032" class="method-detail">
|
866
|
+
<a name="M000032"></a>
|
1022
867
|
|
1023
868
|
<div class="method-heading">
|
1024
|
-
|
1025
|
-
<a href="#M000057" class="method-signature">
|
1026
|
-
|
869
|
+
<a href="#M000032" class="method-signature">
|
1027
870
|
<span class="method-name">clear_values</span><span class="method-args">()</span>
|
1028
|
-
|
1029
871
|
</a>
|
1030
|
-
|
1031
872
|
</div>
|
1032
|
-
|
873
|
+
|
1033
874
|
<div class="method-description">
|
1034
|
-
|
1035
875
|
<p>
|
1036
|
-
Removes all values
|
876
|
+
Removes all <a href="Tag.html#M000033">values</a>.
|
1037
877
|
</p>
|
1038
|
-
|
1039
878
|
<p><a class="source-toggle" href="#"
|
1040
|
-
onclick="toggleCode('
|
1041
|
-
<div class="method-source-code" id="
|
879
|
+
onclick="toggleCode('M000032-source');return false;">[Source]</a></p>
|
880
|
+
<div class="method-source-code" id="M000032-source">
|
1042
881
|
<pre>
|
1043
882
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 437</span>
|
1044
883
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clear_values</span>
|
@@ -1047,84 +886,71 @@ Removes all values.
|
|
1047
886
|
<span class="ruby-keyword kw">end</span>
|
1048
887
|
</pre>
|
1049
888
|
</div>
|
1050
|
-
|
1051
889
|
</div>
|
1052
890
|
</div>
|
1053
891
|
|
1054
|
-
|
1055
|
-
|
1056
|
-
<a name="M000076"></a>
|
892
|
+
<div id="method-M000051" class="method-detail">
|
893
|
+
<a name="M000051"></a>
|
1057
894
|
|
1058
895
|
<div class="method-heading">
|
1059
|
-
|
1060
|
-
<a href="#M000076" class="method-signature">
|
1061
|
-
|
896
|
+
<a href="#M000051" class="method-signature">
|
1062
897
|
<span class="method-name">eql?</span><span class="method-args">(o)</span>
|
1063
|
-
|
1064
898
|
</a>
|
1065
|
-
|
1066
899
|
</div>
|
1067
|
-
|
900
|
+
|
1068
901
|
<div class="method-description">
|
1069
|
-
|
1070
902
|
<p>
|
1071
|
-
Returns true if this tag (including all of its
|
1072
|
-
|
903
|
+
Returns true if this tag (including all of its <a
|
904
|
+
href="Tag.html#M000033">values</a>, <a
|
905
|
+
href="Tag.html#M000038">attributes</a>, and <a
|
906
|
+
href="Tag.html#M000022">children</a>) is equivalent to the given tag.
|
1073
907
|
</p>
|
1074
908
|
<p>
|
1075
909
|
Returns true if the tags are equivalet
|
1076
910
|
</p>
|
1077
|
-
|
1078
911
|
<p><a class="source-toggle" href="#"
|
1079
|
-
onclick="toggleCode('
|
1080
|
-
<div class="method-source-code" id="
|
912
|
+
onclick="toggleCode('M000051-source');return false;">[Source]</a></p>
|
913
|
+
<div class="method-source-code" id="M000051-source">
|
1081
914
|
<pre>
|
1082
|
-
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line
|
915
|
+
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 846</span>
|
1083
916
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">eql?</span>(<span class="ruby-identifier">o</span>)
|
1084
917
|
<span class="ruby-comment cmt"># this is safe because to_string() dumps the full state</span>
|
1085
918
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Tag</span>) <span class="ruby-operator">&&</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">to_string</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">to_string</span>;
|
1086
919
|
<span class="ruby-keyword kw">end</span>
|
1087
920
|
</pre>
|
1088
921
|
</div>
|
1089
|
-
|
1090
922
|
</div>
|
1091
923
|
</div>
|
1092
924
|
|
1093
|
-
|
1094
|
-
|
1095
|
-
<a name="M000062"></a>
|
925
|
+
<div id="method-M000037" class="method-detail">
|
926
|
+
<a name="M000037"></a>
|
1096
927
|
|
1097
928
|
<div class="method-heading">
|
1098
|
-
|
1099
|
-
<a href="#M000062" class="method-signature">
|
1100
|
-
|
929
|
+
<a href="#M000037" class="method-signature">
|
1101
930
|
<span class="method-name">has_attribute?</span><span class="method-args">(namespace = nil, key = nil)</span>
|
1102
|
-
|
1103
931
|
</a>
|
1104
|
-
|
1105
932
|
</div>
|
1106
|
-
|
933
|
+
|
1107
934
|
<div class="method-description">
|
1108
|
-
|
1109
935
|
<p>
|
1110
|
-
Indicates whether there is at least an
|
1111
|
-
href="Tag.html">Tag</a>.
|
936
|
+
Indicates whether there is at least an <a
|
937
|
+
href="Tag.html#M000036">attribute</a> in this <a href="Tag.html">Tag</a>.
|
1112
938
|
</p>
|
1113
939
|
<pre>
|
1114
940
|
has_attribute?
|
1115
941
|
</pre>
|
1116
942
|
<p>
|
1117
|
-
Indicates whether there is the specified
|
943
|
+
Indicates whether there is the specified <a
|
944
|
+
href="Tag.html#M000036">attribute</a> exists in this <a
|
1118
945
|
href="Tag.html">Tag</a>.
|
1119
946
|
</p>
|
1120
947
|
<pre>
|
1121
948
|
has_attribute?(key)
|
1122
949
|
has_attribute?(namespace, key)
|
1123
950
|
</pre>
|
1124
|
-
|
1125
951
|
<p><a class="source-toggle" href="#"
|
1126
|
-
onclick="toggleCode('
|
1127
|
-
<div class="method-source-code" id="
|
952
|
+
onclick="toggleCode('M000037-source');return false;">[Source]</a></p>
|
953
|
+
<div class="method-source-code" id="M000037-source">
|
1128
954
|
<pre>
|
1129
955
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 531</span>
|
1130
956
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">has_attribute?</span>(<span class="ruby-identifier">namespace</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">key</span> = <span class="ruby-keyword kw">nil</span>)
|
@@ -1141,39 +967,32 @@ href="Tag.html">Tag</a>.
|
|
1141
967
|
<span class="ruby-keyword kw">end</span>
|
1142
968
|
</pre>
|
1143
969
|
</div>
|
1144
|
-
|
1145
970
|
</div>
|
1146
971
|
</div>
|
1147
972
|
|
1148
|
-
|
1149
|
-
|
1150
|
-
<a name="M000050"></a>
|
973
|
+
<div id="method-M000025" class="method-detail">
|
974
|
+
<a name="M000025"></a>
|
1151
975
|
|
1152
976
|
<div class="method-heading">
|
1153
|
-
|
1154
|
-
<a href="#M000050" class="method-signature">
|
1155
|
-
|
977
|
+
<a href="#M000025" class="method-signature">
|
1156
978
|
<span class="method-name">has_child?</span><span class="method-args">(name)</span>
|
1157
|
-
|
1158
979
|
</a>
|
1159
|
-
|
1160
980
|
</div>
|
1161
|
-
|
981
|
+
|
1162
982
|
<div class="method-description">
|
1163
|
-
|
1164
983
|
<p>
|
1165
|
-
Indicates whether the
|
1166
|
-
exists.
|
984
|
+
Indicates whether the <a href="Tag.html#M000024">child</a> <a
|
985
|
+
href="Tag.html">Tag</a> of given name exists.
|
1167
986
|
</p>
|
1168
987
|
<table>
|
1169
|
-
<tr><td valign="top"><tt>name</tt>:</td><td>name of the searched
|
988
|
+
<tr><td valign="top"><tt>name</tt>:</td><td>name of the searched <a href="Tag.html#M000024">child</a> <a
|
989
|
+
href="Tag.html">Tag</a>
|
1170
990
|
|
1171
991
|
</td></tr>
|
1172
992
|
</table>
|
1173
|
-
|
1174
993
|
<p><a class="source-toggle" href="#"
|
1175
|
-
onclick="toggleCode('
|
1176
|
-
<div class="method-source-code" id="
|
994
|
+
onclick="toggleCode('M000025-source');return false;">[Source]</a></p>
|
995
|
+
<div class="method-source-code" id="M000025-source">
|
1177
996
|
<pre>
|
1178
997
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 330</span>
|
1179
998
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">has_child?</span>(<span class="ruby-identifier">name</span>)
|
@@ -1181,33 +1000,26 @@ exists.
|
|
1181
1000
|
<span class="ruby-keyword kw">end</span>
|
1182
1001
|
</pre>
|
1183
1002
|
</div>
|
1184
|
-
|
1185
1003
|
</div>
|
1186
1004
|
</div>
|
1187
1005
|
|
1188
|
-
|
1189
|
-
|
1190
|
-
<a name="M000051"></a>
|
1006
|
+
<div id="method-M000026" class="method-detail">
|
1007
|
+
<a name="M000026"></a>
|
1191
1008
|
|
1192
1009
|
<div class="method-heading">
|
1193
|
-
|
1194
|
-
<a href="#M000051" class="method-signature">
|
1195
|
-
|
1010
|
+
<a href="#M000026" class="method-signature">
|
1196
1011
|
<span class="method-name">has_children?</span><span class="method-args">()</span>
|
1197
|
-
|
1198
1012
|
</a>
|
1199
|
-
|
1200
1013
|
</div>
|
1201
|
-
|
1014
|
+
|
1202
1015
|
<div class="method-description">
|
1203
|
-
|
1204
1016
|
<p>
|
1205
|
-
Indicates whether there are
|
1017
|
+
Indicates whether there are <a href="Tag.html#M000022">children</a> <a
|
1018
|
+
href="Tag.html">Tag</a>.
|
1206
1019
|
</p>
|
1207
|
-
|
1208
1020
|
<p><a class="source-toggle" href="#"
|
1209
|
-
onclick="toggleCode('
|
1210
|
-
<div class="method-source-code" id="
|
1021
|
+
onclick="toggleCode('M000026-source');return false;">[Source]</a></p>
|
1022
|
+
<div class="method-source-code" id="M000026-source">
|
1211
1023
|
<pre>
|
1212
1024
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 336</span>
|
1213
1025
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">has_children?</span>
|
@@ -1215,33 +1027,26 @@ Indicates whether there are children <a href="Tag.html">Tag</a>.
|
|
1215
1027
|
<span class="ruby-keyword kw">end</span>
|
1216
1028
|
</pre>
|
1217
1029
|
</div>
|
1218
|
-
|
1219
1030
|
</div>
|
1220
1031
|
</div>
|
1221
1032
|
|
1222
|
-
|
1223
|
-
|
1224
|
-
<a name="M000055"></a>
|
1033
|
+
<div id="method-M000030" class="method-detail">
|
1034
|
+
<a name="M000030"></a>
|
1225
1035
|
|
1226
1036
|
<div class="method-heading">
|
1227
|
-
|
1228
|
-
<a href="#M000055" class="method-signature">
|
1229
|
-
|
1037
|
+
<a href="#M000030" class="method-signature">
|
1230
1038
|
<span class="method-name">has_value?</span><span class="method-args">(v)</span>
|
1231
|
-
|
1232
1039
|
</a>
|
1233
|
-
|
1234
1040
|
</div>
|
1235
|
-
|
1041
|
+
|
1236
1042
|
<div class="method-description">
|
1237
|
-
|
1238
1043
|
<p>
|
1239
|
-
Returns true if <tt>v</tt> is a value of
|
1044
|
+
Returns true if <tt>v</tt> is a <a href="Tag.html#M000020">value</a> of
|
1045
|
+
this <a href="Tag.html">Tag</a>‘s.
|
1240
1046
|
</p>
|
1241
|
-
|
1242
1047
|
<p><a class="source-toggle" href="#"
|
1243
|
-
onclick="toggleCode('
|
1244
|
-
<div class="method-source-code" id="
|
1048
|
+
onclick="toggleCode('M000030-source');return false;">[Source]</a></p>
|
1049
|
+
<div class="method-source-code" id="M000030-source">
|
1245
1050
|
<pre>
|
1246
1051
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 416</span>
|
1247
1052
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">has_value?</span>(<span class="ruby-identifier">v</span>)
|
@@ -1249,60 +1054,46 @@ Returns true if <tt>v</tt> is a value of this Tag’s.
|
|
1249
1054
|
<span class="ruby-keyword kw">end</span>
|
1250
1055
|
</pre>
|
1251
1056
|
</div>
|
1252
|
-
|
1253
1057
|
</div>
|
1254
1058
|
</div>
|
1255
1059
|
|
1256
|
-
|
1257
|
-
|
1258
|
-
<a name="M000078"></a>
|
1060
|
+
<div id="method-M000053" class="method-detail">
|
1061
|
+
<a name="M000053"></a>
|
1259
1062
|
|
1260
1063
|
<div class="method-heading">
|
1261
|
-
|
1262
|
-
<a href="#M000078" class="method-signature">
|
1263
|
-
|
1064
|
+
<a href="#M000053" class="method-signature">
|
1264
1065
|
<span class="method-name">hash</span><span class="method-args">()</span>
|
1265
|
-
|
1266
1066
|
</a>
|
1267
|
-
|
1268
1067
|
</div>
|
1269
|
-
|
1068
|
+
|
1270
1069
|
<div class="method-description">
|
1271
|
-
|
1272
1070
|
<p>
|
1273
|
-
Returns The hash (based on the output from
|
1071
|
+
Returns The <a href="Tag.html#M000053">hash</a> (based on the output from
|
1072
|
+
toString())
|
1274
1073
|
</p>
|
1275
|
-
|
1276
1074
|
<p><a class="source-toggle" href="#"
|
1277
|
-
onclick="toggleCode('
|
1278
|
-
<div class="method-source-code" id="
|
1075
|
+
onclick="toggleCode('M000053-source');return false;">[Source]</a></p>
|
1076
|
+
<div class="method-source-code" id="M000053-source">
|
1279
1077
|
<pre>
|
1280
|
-
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line
|
1078
|
+
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 854</span>
|
1281
1079
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hash</span>
|
1282
1080
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">to_string</span>.<span class="ruby-identifier">hash</span>
|
1283
1081
|
<span class="ruby-keyword kw">end</span>
|
1284
1082
|
</pre>
|
1285
1083
|
</div>
|
1286
|
-
|
1287
1084
|
</div>
|
1288
1085
|
</div>
|
1289
1086
|
|
1290
|
-
|
1291
|
-
|
1292
|
-
<a name="M000068"></a>
|
1087
|
+
<div id="method-M000043" class="method-detail">
|
1088
|
+
<a name="M000043"></a>
|
1293
1089
|
|
1294
1090
|
<div class="method-heading">
|
1295
|
-
|
1296
|
-
<a href="#M000068" class="method-signature">
|
1297
|
-
|
1091
|
+
<a href="#M000043" class="method-signature">
|
1298
1092
|
<span class="method-name">name=</span><span class="method-args">(a_name)</span>
|
1299
|
-
|
1300
1093
|
</a>
|
1301
|
-
|
1302
1094
|
</div>
|
1303
|
-
|
1095
|
+
|
1304
1096
|
<div class="method-description">
|
1305
|
-
|
1306
1097
|
<p>
|
1307
1098
|
Sets the name of this <a href="Tag.html">Tag</a>.
|
1308
1099
|
</p>
|
@@ -1312,10 +1103,9 @@ Raises <tt>ArgumentError</tt> if the name is not a legal SDL
|
|
1312
1103
|
<pre>
|
1313
1104
|
identifier (see SDL4R#validate_identifier)
|
1314
1105
|
</pre>
|
1315
|
-
|
1316
1106
|
<p><a class="source-toggle" href="#"
|
1317
|
-
onclick="toggleCode('
|
1318
|
-
<div class="method-source-code" id="
|
1107
|
+
onclick="toggleCode('M000043-source');return false;">[Source]</a></p>
|
1108
|
+
<div class="method-source-code" id="M000043-source">
|
1319
1109
|
<pre>
|
1320
1110
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 669</span>
|
1321
1111
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">name=</span>(<span class="ruby-identifier">a_name</span>)
|
@@ -1325,26 +1115,19 @@ Raises <tt>ArgumentError</tt> if the name is not a legal SDL
|
|
1325
1115
|
<span class="ruby-keyword kw">end</span>
|
1326
1116
|
</pre>
|
1327
1117
|
</div>
|
1328
|
-
|
1329
1118
|
</div>
|
1330
1119
|
</div>
|
1331
1120
|
|
1332
|
-
|
1333
|
-
|
1334
|
-
<a name="M000069"></a>
|
1121
|
+
<div id="method-M000044" class="method-detail">
|
1122
|
+
<a name="M000044"></a>
|
1335
1123
|
|
1336
1124
|
<div class="method-heading">
|
1337
|
-
|
1338
|
-
<a href="#M000069" class="method-signature">
|
1339
|
-
|
1125
|
+
<a href="#M000044" class="method-signature">
|
1340
1126
|
<span class="method-name">namespace=</span><span class="method-args">(a_namespace)</span>
|
1341
|
-
|
1342
1127
|
</a>
|
1343
|
-
|
1344
1128
|
</div>
|
1345
|
-
|
1129
|
+
|
1346
1130
|
<div class="method-description">
|
1347
|
-
|
1348
1131
|
<p>
|
1349
1132
|
The namespace to set. <tt>nil</tt> will be coerced to the empty string.
|
1350
1133
|
</p>
|
@@ -1354,10 +1137,9 @@ Raises <tt>ArgumentError</tt> if the namespace is non-blank and is not
|
|
1354
1137
|
<pre>
|
1355
1138
|
a legal SDL identifier (see {@link SDL4R#validate_identifier(String)})
|
1356
1139
|
</pre>
|
1357
|
-
|
1358
1140
|
<p><a class="source-toggle" href="#"
|
1359
|
-
onclick="toggleCode('
|
1360
|
-
<div class="method-source-code" id="
|
1141
|
+
onclick="toggleCode('M000044-source');return false;">[Source]</a></p>
|
1142
|
+
<div class="method-source-code" id="M000044-source">
|
1361
1143
|
<pre>
|
1362
1144
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 680</span>
|
1363
1145
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">namespace=</span>(<span class="ruby-identifier">a_namespace</span>)
|
@@ -1367,29 +1149,23 @@ Raises <tt>ArgumentError</tt> if the namespace is non-blank and is not
|
|
1367
1149
|
<span class="ruby-keyword kw">end</span>
|
1368
1150
|
</pre>
|
1369
1151
|
</div>
|
1370
|
-
|
1371
1152
|
</div>
|
1372
1153
|
</div>
|
1373
1154
|
|
1374
|
-
|
1375
|
-
|
1376
|
-
<a name="M000039"></a>
|
1155
|
+
<div id="method-M000014" class="method-detail">
|
1156
|
+
<a name="M000014"></a>
|
1377
1157
|
|
1378
1158
|
<div class="method-heading">
|
1379
|
-
|
1380
|
-
<a href="#M000039" class="method-signature">
|
1381
|
-
|
1159
|
+
<a href="#M000014" class="method-signature">
|
1382
1160
|
<span class="method-name">new_child</span><span class="method-args">(*args, &block)</span>
|
1383
|
-
|
1384
1161
|
</a>
|
1385
|
-
|
1386
1162
|
</div>
|
1387
|
-
|
1163
|
+
|
1388
1164
|
<div class="method-description">
|
1389
|
-
|
1390
1165
|
<p>
|
1391
|
-
Creates a
|
1392
|
-
|
1166
|
+
Creates a <a href="Tag.html#M000013">new</a> <a
|
1167
|
+
href="Tag.html#M000024">child</a> tag. Can take a block so that you can <a
|
1168
|
+
href="Tag.html#M000047">write</a> something like:
|
1393
1169
|
</p>
|
1394
1170
|
<pre>
|
1395
1171
|
car = Tag.new("car") do
|
@@ -1399,15 +1175,16 @@ like:
|
|
1399
1175
|
end
|
1400
1176
|
</pre>
|
1401
1177
|
<p>
|
1402
|
-
The context of execution of the given block is the
|
1178
|
+
The context of execution of the given block is the <a
|
1179
|
+
href="Tag.html#M000024">child</a> instance
|
1403
1180
|
</p>
|
1404
1181
|
<p>
|
1405
|
-
Returns the created
|
1182
|
+
Returns the created <a href="Tag.html#M000024">child</a> <a
|
1183
|
+
href="Tag.html">Tag</a>.
|
1406
1184
|
</p>
|
1407
|
-
|
1408
1185
|
<p><a class="source-toggle" href="#"
|
1409
|
-
onclick="toggleCode('
|
1410
|
-
<div class="method-source-code" id="
|
1186
|
+
onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
|
1187
|
+
<div class="method-source-code" id="M000014-source">
|
1411
1188
|
<pre>
|
1412
1189
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 132</span>
|
1413
1190
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">new_child</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
@@ -1415,38 +1192,31 @@ Returns the created child <a href="Tag.html">Tag</a>.
|
|
1415
1192
|
<span class="ruby-keyword kw">end</span>
|
1416
1193
|
</pre>
|
1417
1194
|
</div>
|
1418
|
-
|
1419
1195
|
</div>
|
1420
1196
|
</div>
|
1421
1197
|
|
1422
|
-
|
1423
|
-
|
1424
|
-
<a name="M000070"></a>
|
1198
|
+
<div id="method-M000045" class="method-detail">
|
1199
|
+
<a name="M000045"></a>
|
1425
1200
|
|
1426
1201
|
<div class="method-heading">
|
1427
|
-
|
1428
|
-
<a href="#M000070" class="method-signature">
|
1429
|
-
|
1202
|
+
<a href="#M000045" class="method-signature">
|
1430
1203
|
<span class="method-name">read</span><span class="method-args">(input)</span>
|
1431
|
-
|
1432
1204
|
</a>
|
1433
|
-
|
1434
1205
|
</div>
|
1435
|
-
|
1206
|
+
|
1436
1207
|
<div class="method-description">
|
1437
|
-
|
1438
1208
|
<p>
|
1439
1209
|
Adds all the tags specified in the given IO, String, Pathname or URI to
|
1440
1210
|
this <a href="Tag.html">Tag</a>.
|
1441
1211
|
</p>
|
1442
1212
|
<p>
|
1443
|
-
Returns this <a href="Tag.html">Tag</a> after adding all the
|
1213
|
+
Returns this <a href="Tag.html">Tag</a> after adding all the <a
|
1214
|
+
href="Tag.html#M000022">children</a> <a href="Tag.html#M000045">read</a>
|
1444
1215
|
from <tt>input</tt>.
|
1445
1216
|
</p>
|
1446
|
-
|
1447
1217
|
<p><a class="source-toggle" href="#"
|
1448
|
-
onclick="toggleCode('
|
1449
|
-
<div class="method-source-code" id="
|
1218
|
+
onclick="toggleCode('M000045-source');return false;">[Source]</a></p>
|
1219
|
+
<div class="method-source-code" id="M000045-source">
|
1450
1220
|
<pre>
|
1451
1221
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 690</span>
|
1452
1222
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read</span>(<span class="ruby-identifier">input</span>)
|
@@ -1467,34 +1237,26 @@ from <tt>input</tt>.
|
|
1467
1237
|
<span class="ruby-keyword kw">end</span>
|
1468
1238
|
</pre>
|
1469
1239
|
</div>
|
1470
|
-
|
1471
1240
|
</div>
|
1472
1241
|
</div>
|
1473
1242
|
|
1474
|
-
|
1475
|
-
|
1476
|
-
<a name="M000071"></a>
|
1243
|
+
<div id="method-M000046" class="method-detail">
|
1244
|
+
<a name="M000046"></a>
|
1477
1245
|
|
1478
1246
|
<div class="method-heading">
|
1479
|
-
|
1480
|
-
<a href="#M000071" class="method-signature">
|
1481
|
-
|
1247
|
+
<a href="#M000046" class="method-signature">
|
1482
1248
|
<span class="method-name">read_from_io</span><span class="method-args">(close_io) {|| ...}</span>
|
1483
|
-
|
1484
1249
|
</a>
|
1485
|
-
|
1486
1250
|
</div>
|
1487
|
-
|
1251
|
+
|
1488
1252
|
<div class="method-description">
|
1489
|
-
|
1490
1253
|
<p>
|
1491
1254
|
Reads and parses the <tt>io</tt> returned by the specified block and closes
|
1492
1255
|
this <tt>io</tt> if <tt>close_io</tt> is true.
|
1493
1256
|
</p>
|
1494
|
-
|
1495
1257
|
<p><a class="source-toggle" href="#"
|
1496
|
-
onclick="toggleCode('
|
1497
|
-
<div class="method-source-code" id="
|
1258
|
+
onclick="toggleCode('M000046-source');return false;">[Source]</a></p>
|
1259
|
+
<div class="method-source-code" id="M000046-source">
|
1498
1260
|
<pre>
|
1499
1261
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 709</span>
|
1500
1262
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read_from_io</span>(<span class="ruby-identifier">close_io</span>)
|
@@ -1513,50 +1275,44 @@ this <tt>io</tt> if <tt>close_io</tt> is true.
|
|
1513
1275
|
<span class="ruby-keyword kw">end</span>
|
1514
1276
|
</pre>
|
1515
1277
|
</div>
|
1516
|
-
|
1517
1278
|
</div>
|
1518
1279
|
</div>
|
1519
1280
|
|
1520
|
-
|
1521
|
-
|
1522
|
-
<a name="M000064"></a>
|
1281
|
+
<div id="method-M000039" class="method-detail">
|
1282
|
+
<a name="M000039"></a>
|
1523
1283
|
|
1524
1284
|
<div class="method-heading">
|
1525
|
-
|
1526
|
-
<a href="#M000064" class="method-signature">
|
1527
|
-
|
1285
|
+
<a href="#M000039" class="method-signature">
|
1528
1286
|
<span class="method-name">remove_attribute</span><span class="method-args">(namespace, key = nil)</span>
|
1529
|
-
|
1530
1287
|
</a>
|
1531
|
-
|
1532
1288
|
</div>
|
1533
|
-
|
1289
|
+
|
1534
1290
|
<div class="method-description">
|
1535
|
-
|
1536
1291
|
<pre>
|
1537
1292
|
remove_attribute(key)
|
1538
1293
|
remove_attribute(namespace, key)
|
1539
1294
|
</pre>
|
1540
1295
|
<p>
|
1541
|
-
Removes the attribute
|
1296
|
+
Removes the <a href="Tag.html#M000036">attribute</a>, whose name and
|
1297
|
+
namespace are specified.
|
1542
1298
|
</p>
|
1543
1299
|
<table>
|
1544
1300
|
<tr><td valign="top"><tt>key</tt>:</td><td>name of the removed atribute
|
1545
1301
|
|
1546
1302
|
</td></tr>
|
1547
|
-
<tr><td valign="top"><tt>namespace</tt>:</td><td>namespace of the removed attribute (equal to
|
1548
|
-
namespace, by default)
|
1303
|
+
<tr><td valign="top"><tt>namespace</tt>:</td><td>namespace of the removed <a href="Tag.html#M000036">attribute</a> (equal to
|
1304
|
+
"", default namespace, by default)
|
1549
1305
|
|
1550
1306
|
</td></tr>
|
1551
1307
|
</table>
|
1552
1308
|
<p>
|
1553
|
-
Returns the value of the removed
|
1554
|
-
didn&#
|
1309
|
+
Returns the <a href="Tag.html#M000020">value</a> of the removed <a
|
1310
|
+
href="Tag.html#M000036">attribute</a> or <tt>nil</tt> if it didn‘t
|
1311
|
+
exist.
|
1555
1312
|
</p>
|
1556
|
-
|
1557
1313
|
<p><a class="source-toggle" href="#"
|
1558
|
-
onclick="toggleCode('
|
1559
|
-
<div class="method-source-code" id="
|
1314
|
+
onclick="toggleCode('M000039-source');return false;">[Source]</a></p>
|
1315
|
+
<div class="method-source-code" id="M000039-source">
|
1560
1316
|
<pre>
|
1561
1317
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 587</span>
|
1562
1318
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove_attribute</span>(<span class="ruby-identifier">namespace</span>, <span class="ruby-identifier">key</span> = <span class="ruby-keyword kw">nil</span>)
|
@@ -1566,41 +1322,35 @@ didn’t exist.
|
|
1566
1322
|
<span class="ruby-keyword kw">end</span>
|
1567
1323
|
</pre>
|
1568
1324
|
</div>
|
1569
|
-
|
1570
1325
|
</div>
|
1571
1326
|
</div>
|
1572
1327
|
|
1573
|
-
|
1574
|
-
|
1575
|
-
<a name="M000042"></a>
|
1328
|
+
<div id="method-M000017" class="method-detail">
|
1329
|
+
<a name="M000017"></a>
|
1576
1330
|
|
1577
1331
|
<div class="method-heading">
|
1578
|
-
|
1579
|
-
<a href="#M000042" class="method-signature">
|
1580
|
-
|
1332
|
+
<a href="#M000017" class="method-signature">
|
1581
1333
|
<span class="method-name">remove_child</span><span class="method-args">(child)</span>
|
1582
|
-
|
1583
1334
|
</a>
|
1584
|
-
|
1585
1335
|
</div>
|
1586
|
-
|
1336
|
+
|
1587
1337
|
<div class="method-description">
|
1588
|
-
|
1589
1338
|
<p>
|
1590
|
-
Remove a
|
1339
|
+
Remove a <a href="Tag.html#M000024">child</a> from this <a
|
1340
|
+
href="Tag.html">Tag</a>
|
1591
1341
|
</p>
|
1592
1342
|
<table>
|
1593
|
-
<tr><td valign="top"><tt>child</tt>:</td><td>the child to remove
|
1343
|
+
<tr><td valign="top"><tt><a href="Tag.html#M000024">child</a></tt>:</td><td>the <a href="Tag.html#M000024">child</a> to remove
|
1594
1344
|
|
1595
1345
|
</td></tr>
|
1596
1346
|
</table>
|
1597
1347
|
<p>
|
1598
|
-
Returns true if the child exists and is
|
1348
|
+
Returns true if the <a href="Tag.html#M000024">child</a> exists and is
|
1349
|
+
removed
|
1599
1350
|
</p>
|
1600
|
-
|
1601
1351
|
<p><a class="source-toggle" href="#"
|
1602
|
-
onclick="toggleCode('
|
1603
|
-
<div class="method-source-code" id="
|
1352
|
+
onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
|
1353
|
+
<div class="method-source-code" id="M000017-source">
|
1604
1354
|
<pre>
|
1605
1355
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 199</span>
|
1606
1356
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove_child</span>(<span class="ruby-identifier">child</span>)
|
@@ -1608,42 +1358,35 @@ Returns true if the child exists and is removed
|
|
1608
1358
|
<span class="ruby-keyword kw">end</span>
|
1609
1359
|
</pre>
|
1610
1360
|
</div>
|
1611
|
-
|
1612
1361
|
</div>
|
1613
1362
|
</div>
|
1614
1363
|
|
1615
|
-
|
1616
|
-
|
1617
|
-
<a name="M000056"></a>
|
1364
|
+
<div id="method-M000031" class="method-detail">
|
1365
|
+
<a name="M000031"></a>
|
1618
1366
|
|
1619
1367
|
<div class="method-heading">
|
1620
|
-
|
1621
|
-
<a href="#M000056" class="method-signature">
|
1622
|
-
|
1368
|
+
<a href="#M000031" class="method-signature">
|
1623
1369
|
<span class="method-name">remove_value</span><span class="method-args">(v)</span>
|
1624
|
-
|
1625
1370
|
</a>
|
1626
|
-
|
1627
1371
|
</div>
|
1628
|
-
|
1372
|
+
|
1629
1373
|
<div class="method-description">
|
1630
|
-
|
1631
1374
|
<p>
|
1632
|
-
Removes the first occurence of the specified
|
1633
|
-
href="Tag.html">Tag</a>.
|
1375
|
+
Removes the first occurence of the specified <a
|
1376
|
+
href="Tag.html#M000020">value</a> from this <a href="Tag.html">Tag</a>.
|
1634
1377
|
</p>
|
1635
1378
|
<table>
|
1636
|
-
<tr><td valign="top"><tt>v</tt>:</td><td>The value to remove
|
1379
|
+
<tr><td valign="top"><tt>v</tt>:</td><td>The <a href="Tag.html#M000020">value</a> to remove
|
1637
1380
|
|
1638
1381
|
</td></tr>
|
1639
1382
|
</table>
|
1640
1383
|
<p>
|
1641
|
-
Returns true If the value exists and is
|
1384
|
+
Returns true If the <a href="Tag.html#M000020">value</a> exists and is
|
1385
|
+
removed
|
1642
1386
|
</p>
|
1643
|
-
|
1644
1387
|
<p><a class="source-toggle" href="#"
|
1645
|
-
onclick="toggleCode('
|
1646
|
-
<div class="method-source-code" id="
|
1388
|
+
onclick="toggleCode('M000031-source');return false;">[Source]</a></p>
|
1389
|
+
<div class="method-source-code" id="M000031-source">
|
1647
1390
|
<pre>
|
1648
1391
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 426</span>
|
1649
1392
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove_value</span>(<span class="ruby-identifier">v</span>)
|
@@ -1656,43 +1399,38 @@ Returns true If the value exists and is removed
|
|
1656
1399
|
<span class="ruby-keyword kw">end</span>
|
1657
1400
|
</pre>
|
1658
1401
|
</div>
|
1659
|
-
|
1660
1402
|
</div>
|
1661
1403
|
</div>
|
1662
1404
|
|
1663
|
-
|
1664
|
-
|
1665
|
-
<a name="M000060"></a>
|
1405
|
+
<div id="method-M000035" class="method-detail">
|
1406
|
+
<a name="M000035"></a>
|
1666
1407
|
|
1667
1408
|
<div class="method-heading">
|
1668
|
-
|
1669
|
-
<
|
1670
|
-
|
1671
|
-
<span class="method-name">set_attribute</span><span class="method-args">(namespace, key, value = nil)</span>
|
1672
|
-
|
1409
|
+
<a href="#M000035" class="method-signature">
|
1410
|
+
<span class="method-name">set_attribute</span><span class="method-args">(namespace, key, value = :default)</span>
|
1673
1411
|
</a>
|
1674
|
-
|
1675
1412
|
</div>
|
1676
|
-
|
1413
|
+
|
1677
1414
|
<div class="method-description">
|
1678
|
-
|
1679
1415
|
<pre>
|
1680
1416
|
set_attribute(key, value)
|
1681
1417
|
set_attribute(namespace, key, value)
|
1682
1418
|
</pre>
|
1683
1419
|
<p>
|
1684
|
-
Set an attribute in the given namespace for
|
1685
|
-
|
1686
|
-
|
1420
|
+
Set an <a href="Tag.html#M000036">attribute</a> in the given namespace for
|
1421
|
+
this tag. The allowable <a href="Tag.html#M000036">attribute</a> <a
|
1422
|
+
href="Tag.html#M000020">value</a> types are the same as those allowed for
|
1423
|
+
{@link addValue(Object)}
|
1687
1424
|
</p>
|
1688
1425
|
<table>
|
1689
|
-
<tr><td valign="top"><tt>namespace</tt>:</td><td>The namespace for this attribute
|
1426
|
+
<tr><td valign="top"><tt>namespace</tt>:</td><td>The namespace for this <a href="Tag.html#M000036">attribute</a>
|
1690
1427
|
|
1691
1428
|
</td></tr>
|
1692
|
-
<tr><td valign="top"><tt>key</tt>:</td><td>The attribute key
|
1429
|
+
<tr><td valign="top"><tt>key</tt>:</td><td>The <a href="Tag.html#M000036">attribute</a> key
|
1693
1430
|
|
1694
1431
|
</td></tr>
|
1695
|
-
<tr><td valign="top"><tt>value</tt>:</td><td>The attribute
|
1432
|
+
<tr><td valign="top"><tt><a href="Tag.html#M000020">value</a></tt>:</td><td>The <a href="Tag.html#M000036">attribute</a> <a
|
1433
|
+
href="Tag.html#M000020">value</a>
|
1696
1434
|
|
1697
1435
|
</td></tr>
|
1698
1436
|
</table>
|
@@ -1704,14 +1442,13 @@ addValue(Object)}
|
|
1704
1442
|
namespace is non-blank and is not a legal SDL identifier, or the
|
1705
1443
|
value is not a legal SDL type
|
1706
1444
|
</pre>
|
1707
|
-
|
1708
1445
|
<p><a class="source-toggle" href="#"
|
1709
|
-
onclick="toggleCode('
|
1710
|
-
<div class="method-source-code" id="
|
1446
|
+
onclick="toggleCode('M000035-source');return false;">[Source]</a></p>
|
1447
|
+
<div class="method-source-code" id="M000035-source">
|
1711
1448
|
<pre>
|
1712
1449
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 488</span>
|
1713
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_attribute</span>(<span class="ruby-identifier">namespace</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span> = <span class="ruby-
|
1714
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span
|
1450
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_attribute</span>(<span class="ruby-identifier">namespace</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span> = <span class="ruby-identifier">:default</span>)
|
1451
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:default</span>
|
1715
1452
|
<span class="ruby-identifier">value</span> = <span class="ruby-identifier">key</span>
|
1716
1453
|
<span class="ruby-identifier">key</span> = <span class="ruby-identifier">namespace</span>
|
1717
1454
|
<span class="ruby-identifier">namespace</span> = <span class="ruby-value str">""</span>
|
@@ -1735,41 +1472,36 @@ addValue(Object)}
|
|
1735
1472
|
<span class="ruby-keyword kw">end</span>
|
1736
1473
|
</pre>
|
1737
1474
|
</div>
|
1738
|
-
|
1739
1475
|
</div>
|
1740
1476
|
</div>
|
1741
1477
|
|
1742
|
-
|
1743
|
-
|
1744
|
-
<a name="M000066"></a>
|
1478
|
+
<div id="method-M000041" class="method-detail">
|
1479
|
+
<a name="M000041"></a>
|
1745
1480
|
|
1746
1481
|
<div class="method-heading">
|
1747
|
-
|
1748
|
-
<a href="#M000066" class="method-signature">
|
1749
|
-
|
1482
|
+
<a href="#M000041" class="method-signature">
|
1750
1483
|
<span class="method-name">set_attributes</span><span class="method-args">(namespace, attribute_hash = nil)</span>
|
1751
|
-
|
1752
1484
|
</a>
|
1753
|
-
|
1754
1485
|
</div>
|
1755
|
-
|
1486
|
+
|
1756
1487
|
<div class="method-description">
|
1757
|
-
|
1758
1488
|
<pre>
|
1759
1489
|
set_attributes(attribute_hash)
|
1760
1490
|
set_attributes(namespace, attribute_hash)
|
1761
1491
|
</pre>
|
1762
1492
|
<p>
|
1763
|
-
Sets the attributes specified by a Hash in
|
1764
|
-
one operation. The previous
|
1765
|
-
|
1766
|
-
|
1493
|
+
Sets the <a href="Tag.html#M000038">attributes</a> specified by a Hash in
|
1494
|
+
the given <tt>namespace</tt> in one operation. The previous <a
|
1495
|
+
href="Tag.html#M000038">attributes</a> of the specified <tt>namespace</tt>
|
1496
|
+
are removed. See <a href="Tag.html#M000035">set_attribute</a> for allowable
|
1497
|
+
<a href="Tag.html#M000036">attribute</a> <a
|
1498
|
+
href="Tag.html#M000020">value</a> types.
|
1767
1499
|
</p>
|
1768
1500
|
<table>
|
1769
|
-
<tr><td valign="top"><tt>attributes</tt>:</td><td>a Hash where keys are attribute keys
|
1501
|
+
<tr><td valign="top"><tt><a href="Tag.html#M000038">attributes</a></tt>:</td><td>a Hash where keys are <a href="Tag.html#M000036">attribute</a> keys
|
1770
1502
|
|
1771
1503
|
</td></tr>
|
1772
|
-
<tr><td valign="top"><tt>namespace</tt>:</td><td
|
1504
|
+
<tr><td valign="top"><tt>namespace</tt>:</td><td>"" (default namespace) by default
|
1773
1505
|
|
1774
1506
|
</td></tr>
|
1775
1507
|
</table>
|
@@ -1780,10 +1512,9 @@ Raises an <tt>ArgumentError</tt> if any key in the map is not a legal SDL
|
|
1780
1512
|
identifier (see SDL4R#validate_identifier), or any value
|
1781
1513
|
is not a legal SDL type.
|
1782
1514
|
</pre>
|
1783
|
-
|
1784
1515
|
<p><a class="source-toggle" href="#"
|
1785
|
-
onclick="toggleCode('
|
1786
|
-
<div class="method-source-code" id="
|
1516
|
+
onclick="toggleCode('M000041-source');return false;">[Source]</a></p>
|
1517
|
+
<div class="method-source-code" id="M000041-source">
|
1787
1518
|
<pre>
|
1788
1519
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 637</span>
|
1789
1520
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_attributes</span>(<span class="ruby-identifier">namespace</span>, <span class="ruby-identifier">attribute_hash</span> = <span class="ruby-keyword kw">nil</span>)
|
@@ -1805,29 +1536,24 @@ Raises an <tt>ArgumentError</tt> if any key in the map is not a legal SDL
|
|
1805
1536
|
<span class="ruby-keyword kw">end</span>
|
1806
1537
|
</pre>
|
1807
1538
|
</div>
|
1808
|
-
|
1809
1539
|
</div>
|
1810
1540
|
</div>
|
1811
1541
|
|
1812
|
-
|
1813
|
-
|
1814
|
-
<a name="M000052"></a>
|
1542
|
+
<div id="method-M000027" class="method-detail">
|
1543
|
+
<a name="M000027"></a>
|
1815
1544
|
|
1816
1545
|
<div class="method-heading">
|
1817
|
-
|
1818
|
-
<a href="#M000052" class="method-signature">
|
1819
|
-
|
1546
|
+
<a href="#M000027" class="method-signature">
|
1820
1547
|
<span class="method-name">to_child_hash</span><span class="method-args">()</span>
|
1821
|
-
|
1822
1548
|
</a>
|
1823
|
-
|
1824
1549
|
</div>
|
1825
|
-
|
1550
|
+
|
1826
1551
|
<div class="method-description">
|
1827
|
-
|
1828
1552
|
<p>
|
1829
|
-
Returns a new Hash where the
|
1830
|
-
|
1553
|
+
Returns a <a href="Tag.html#M000013">new</a> Hash where the <a
|
1554
|
+
href="Tag.html#M000022">children</a>‘s names as keys and their <a
|
1555
|
+
href="Tag.html#M000033">values</a> as the key‘s <a
|
1556
|
+
href="Tag.html#M000020">value</a>. Example:
|
1831
1557
|
</p>
|
1832
1558
|
<pre>
|
1833
1559
|
child1 "toto"
|
@@ -1839,10 +1565,9 @@ would give
|
|
1839
1565
|
<pre>
|
1840
1566
|
{ "child1" => "toto", "child2" => 2 }
|
1841
1567
|
</pre>
|
1842
|
-
|
1843
1568
|
<p><a class="source-toggle" href="#"
|
1844
|
-
onclick="toggleCode('
|
1845
|
-
<div class="method-source-code" id="
|
1569
|
+
onclick="toggleCode('M000027-source');return false;">[Source]</a></p>
|
1570
|
+
<div class="method-source-code" id="M000027-source">
|
1846
1571
|
<pre>
|
1847
1572
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 375</span>
|
1848
1573
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_child_hash</span>
|
@@ -1852,30 +1577,26 @@ would give
|
|
1852
1577
|
<span class="ruby-keyword kw">end</span>
|
1853
1578
|
</pre>
|
1854
1579
|
</div>
|
1855
|
-
|
1856
1580
|
</div>
|
1857
1581
|
</div>
|
1858
1582
|
|
1859
|
-
|
1860
|
-
|
1861
|
-
<a name="M000053"></a>
|
1583
|
+
<div id="method-M000028" class="method-detail">
|
1584
|
+
<a name="M000028"></a>
|
1862
1585
|
|
1863
1586
|
<div class="method-heading">
|
1864
|
-
|
1865
|
-
<a href="#M000053" class="method-signature">
|
1866
|
-
|
1587
|
+
<a href="#M000028" class="method-signature">
|
1867
1588
|
<span class="method-name">to_child_string_hash</span><span class="method-args">()</span>
|
1868
|
-
|
1869
1589
|
</a>
|
1870
|
-
|
1871
1590
|
</div>
|
1872
|
-
|
1591
|
+
|
1873
1592
|
<div class="method-description">
|
1874
|
-
|
1875
1593
|
<p>
|
1876
|
-
Returns a new Hash where the
|
1877
|
-
|
1878
|
-
|
1594
|
+
Returns a <a href="Tag.html#M000013">new</a> Hash where the <a
|
1595
|
+
href="Tag.html#M000022">children</a>‘s names as keys and their <a
|
1596
|
+
href="Tag.html#M000033">values</a> as the key‘s <a
|
1597
|
+
href="Tag.html#M000020">value</a>. Values are converted to Strings.
|
1598
|
+
<tt>nil</tt> <a href="Tag.html#M000033">values</a> become empty Strings.
|
1599
|
+
Example:
|
1879
1600
|
</p>
|
1880
1601
|
<pre>
|
1881
1602
|
child1 "toto"
|
@@ -1888,10 +1609,9 @@ would give
|
|
1888
1609
|
<pre>
|
1889
1610
|
{ "child1" => "toto", "child2" => "2", "child3" => "" }
|
1890
1611
|
</pre>
|
1891
|
-
|
1892
1612
|
<p><a class="source-toggle" href="#"
|
1893
|
-
onclick="toggleCode('
|
1894
|
-
<div class="method-source-code" id="
|
1613
|
+
onclick="toggleCode('M000028-source');return false;">[Source]</a></p>
|
1614
|
+
<div class="method-source-code" id="M000028-source">
|
1895
1615
|
<pre>
|
1896
1616
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 393</span>
|
1897
1617
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_child_string_hash</span>
|
@@ -1905,65 +1625,51 @@ would give
|
|
1905
1625
|
<span class="ruby-keyword kw">end</span>
|
1906
1626
|
</pre>
|
1907
1627
|
</div>
|
1908
|
-
|
1909
1628
|
</div>
|
1910
1629
|
</div>
|
1911
1630
|
|
1912
|
-
|
1913
|
-
|
1914
|
-
<a name="M000073"></a>
|
1631
|
+
<div id="method-M000048" class="method-detail">
|
1632
|
+
<a name="M000048"></a>
|
1915
1633
|
|
1916
1634
|
<div class="method-heading">
|
1917
|
-
|
1918
|
-
<a href="#M000073" class="method-signature">
|
1919
|
-
|
1635
|
+
<a href="#M000048" class="method-signature">
|
1920
1636
|
<span class="method-name">to_s</span><span class="method-args">()</span>
|
1921
|
-
|
1922
1637
|
</a>
|
1923
|
-
|
1924
1638
|
</div>
|
1925
|
-
|
1639
|
+
|
1926
1640
|
<div class="method-description">
|
1927
|
-
|
1928
1641
|
<p>
|
1929
1642
|
Get a String representation of this SDL <a href="Tag.html">Tag</a>. This
|
1930
|
-
method returns a complete description of the
|
1931
|
-
(i.e. the output can be
|
1643
|
+
method returns a complete description of the <a
|
1644
|
+
href="Tag.html">Tag</a>‘s state using SDL (i.e. the output can be
|
1645
|
+
parsed by {@link read(String)})
|
1932
1646
|
</p>
|
1933
1647
|
<p>
|
1934
1648
|
Returns A string representation of this tag using SDL
|
1935
1649
|
</p>
|
1936
|
-
|
1937
1650
|
<p><a class="source-toggle" href="#"
|
1938
|
-
onclick="toggleCode('
|
1939
|
-
<div class="method-source-code" id="
|
1651
|
+
onclick="toggleCode('M000048-source');return false;">[Source]</a></p>
|
1652
|
+
<div class="method-source-code" id="M000048-source">
|
1940
1653
|
<pre>
|
1941
|
-
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line
|
1654
|
+
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 766</span>
|
1942
1655
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
|
1943
1656
|
<span class="ruby-identifier">to_string</span>
|
1944
1657
|
<span class="ruby-keyword kw">end</span>
|
1945
1658
|
</pre>
|
1946
1659
|
</div>
|
1947
|
-
|
1948
1660
|
</div>
|
1949
1661
|
</div>
|
1950
1662
|
|
1951
|
-
|
1952
|
-
|
1953
|
-
<a name="M000074"></a>
|
1663
|
+
<div id="method-M000049" class="method-detail">
|
1664
|
+
<a name="M000049"></a>
|
1954
1665
|
|
1955
1666
|
<div class="method-heading">
|
1956
|
-
|
1957
|
-
<a href="#M000074" class="method-signature">
|
1958
|
-
|
1667
|
+
<a href="#M000049" class="method-signature">
|
1959
1668
|
<span class="method-name">to_string</span><span class="method-args">(line_prefix = "", indent = "\t")</span>
|
1960
|
-
|
1961
1669
|
</a>
|
1962
|
-
|
1963
1670
|
</div>
|
1964
|
-
|
1671
|
+
|
1965
1672
|
<div class="method-description">
|
1966
|
-
|
1967
1673
|
<table>
|
1968
1674
|
<tr><td valign="top"><tt>linePrefix</tt>:</td><td>A prefix to insert before every line.
|
1969
1675
|
|
@@ -1975,12 +1681,11 @@ Returns A string representation of this tag using SDL
|
|
1975
1681
|
<p>
|
1976
1682
|
TODO: break up long lines using the backslash
|
1977
1683
|
</p>
|
1978
|
-
|
1979
1684
|
<p><a class="source-toggle" href="#"
|
1980
|
-
onclick="toggleCode('
|
1981
|
-
<div class="method-source-code" id="
|
1685
|
+
onclick="toggleCode('M000049-source');return false;">[Source]</a></p>
|
1686
|
+
<div class="method-source-code" id="M000049-source">
|
1982
1687
|
<pre>
|
1983
|
-
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line
|
1688
|
+
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 776</span>
|
1984
1689
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_string</span>(<span class="ruby-identifier">line_prefix</span> = <span class="ruby-value str">""</span>, <span class="ruby-identifier">indent</span> = <span class="ruby-value str">"\t"</span>)
|
1985
1690
|
<span class="ruby-identifier">line_prefix</span> = <span class="ruby-value str">""</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">line_prefix</span>.<span class="ruby-identifier">nil?</span>
|
1986
1691
|
<span class="ruby-identifier">s</span> = <span class="ruby-value str">""</span>
|
@@ -2032,26 +1737,19 @@ TODO: break up long lines using the backslash
|
|
2032
1737
|
<span class="ruby-keyword kw">end</span>
|
2033
1738
|
</pre>
|
2034
1739
|
</div>
|
2035
|
-
|
2036
1740
|
</div>
|
2037
1741
|
</div>
|
2038
1742
|
|
2039
|
-
|
2040
|
-
|
2041
|
-
<a name="M000079"></a>
|
1743
|
+
<div id="method-M000054" class="method-detail">
|
1744
|
+
<a name="M000054"></a>
|
2042
1745
|
|
2043
1746
|
<div class="method-heading">
|
2044
|
-
|
2045
|
-
<a href="#M000079" class="method-signature">
|
2046
|
-
|
1747
|
+
<a href="#M000054" class="method-signature">
|
2047
1748
|
<span class="method-name">to_xml_string</span><span class="method-args">(line_prefix = "", uri_by_namespace = nil)</span>
|
2048
|
-
|
2049
1749
|
</a>
|
2050
|
-
|
2051
1750
|
</div>
|
2052
|
-
|
1751
|
+
|
2053
1752
|
<div class="method-description">
|
2054
|
-
|
2055
1753
|
<p>
|
2056
1754
|
Returns a string containing an XML representation of this tag. Values will
|
2057
1755
|
be represented using _val0, _val1, etc.
|
@@ -2064,12 +1762,11 @@ be represented using _val0, _val1, etc.
|
|
2064
1762
|
|
2065
1763
|
</td></tr>
|
2066
1764
|
</table>
|
2067
|
-
|
2068
1765
|
<p><a class="source-toggle" href="#"
|
2069
|
-
onclick="toggleCode('
|
2070
|
-
<div class="method-source-code" id="
|
1766
|
+
onclick="toggleCode('M000054-source');return false;">[Source]</a></p>
|
1767
|
+
<div class="method-source-code" id="M000054-source">
|
2071
1768
|
<pre>
|
2072
|
-
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line
|
1769
|
+
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 864</span>
|
2073
1770
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_xml_string</span>(<span class="ruby-identifier">line_prefix</span> = <span class="ruby-value str">""</span>, <span class="ruby-identifier">uri_by_namespace</span> = <span class="ruby-keyword kw">nil</span>)
|
2074
1771
|
<span class="ruby-identifier">line_prefix</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">""</span>
|
2075
1772
|
|
@@ -2124,33 +1821,26 @@ be represented using _val0, _val1, etc.
|
|
2124
1821
|
<span class="ruby-keyword kw">end</span>
|
2125
1822
|
</pre>
|
2126
1823
|
</div>
|
2127
|
-
|
2128
1824
|
</div>
|
2129
1825
|
</div>
|
2130
1826
|
|
2131
|
-
|
2132
|
-
|
2133
|
-
<a name="M000045"></a>
|
1827
|
+
<div id="method-M000020" class="method-detail">
|
1828
|
+
<a name="M000020"></a>
|
2134
1829
|
|
2135
1830
|
<div class="method-heading">
|
2136
|
-
|
2137
|
-
<a href="#M000045" class="method-signature">
|
2138
|
-
|
1831
|
+
<a href="#M000020" class="method-signature">
|
2139
1832
|
<span class="method-name">value</span><span class="method-args">()</span>
|
2140
|
-
|
2141
1833
|
</a>
|
2142
|
-
|
2143
1834
|
</div>
|
2144
|
-
|
1835
|
+
|
2145
1836
|
<div class="method-description">
|
2146
|
-
|
2147
1837
|
<p>
|
2148
|
-
A convenience method that returns the first
|
1838
|
+
A convenience method that returns the first <a
|
1839
|
+
href="Tag.html#M000020">value</a>.
|
2149
1840
|
</p>
|
2150
|
-
|
2151
1841
|
<p><a class="source-toggle" href="#"
|
2152
|
-
onclick="toggleCode('
|
2153
|
-
<div class="method-source-code" id="
|
1842
|
+
onclick="toggleCode('M000020-source');return false;">[Source]</a></p>
|
1843
|
+
<div class="method-source-code" id="M000020-source">
|
2154
1844
|
<pre>
|
2155
1845
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 228</span>
|
2156
1846
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">value</span>
|
@@ -2158,45 +1848,39 @@ A convenience method that returns the first value.
|
|
2158
1848
|
<span class="ruby-keyword kw">end</span>
|
2159
1849
|
</pre>
|
2160
1850
|
</div>
|
2161
|
-
|
2162
1851
|
</div>
|
2163
1852
|
</div>
|
2164
1853
|
|
2165
|
-
|
2166
|
-
|
2167
|
-
<a name="M000044"></a>
|
1854
|
+
<div id="method-M000019" class="method-detail">
|
1855
|
+
<a name="M000019"></a>
|
2168
1856
|
|
2169
1857
|
<div class="method-heading">
|
2170
|
-
|
2171
|
-
<a href="#M000044" class="method-signature">
|
2172
|
-
|
1858
|
+
<a href="#M000019" class="method-signature">
|
2173
1859
|
<span class="method-name">value=</span><span class="method-args">(value)</span>
|
2174
|
-
|
2175
1860
|
</a>
|
2176
|
-
|
2177
1861
|
</div>
|
2178
|
-
|
1862
|
+
|
2179
1863
|
<div class="method-description">
|
2180
|
-
|
2181
1864
|
<p>
|
2182
|
-
A convenience method that sets the first
|
2183
|
-
|
1865
|
+
A convenience method that sets the first <a
|
1866
|
+
href="Tag.html#M000020">value</a> in the <a
|
1867
|
+
href="Tag.html#M000020">value</a> list. See {@link addValue(Object)} for
|
1868
|
+
legal types.
|
2184
1869
|
</p>
|
2185
1870
|
<table>
|
2186
|
-
<tr><td valign="top"><tt>value</tt>:</td><td>The value to be set.
|
1871
|
+
<tr><td valign="top"><tt><a href="Tag.html#M000020">value</a></tt>:</td><td>The <a href="Tag.html#M000020">value</a> to be set.
|
2187
1872
|
|
2188
1873
|
</td></tr>
|
2189
1874
|
</table>
|
2190
1875
|
<h3>Raises</h3>
|
2191
1876
|
<table>
|
2192
|
-
<tr><td valign="top"><tt>ArgumentError</tt>:</td><td>if the value is not a legal SDL type
|
1877
|
+
<tr><td valign="top"><tt>ArgumentError</tt>:</td><td>if the <a href="Tag.html#M000020">value</a> is not a legal SDL type
|
2193
1878
|
|
2194
1879
|
</td></tr>
|
2195
1880
|
</table>
|
2196
|
-
|
2197
1881
|
<p><a class="source-toggle" href="#"
|
2198
|
-
onclick="toggleCode('
|
2199
|
-
<div class="method-source-code" id="
|
1882
|
+
onclick="toggleCode('M000019-source');return false;">[Source]</a></p>
|
1883
|
+
<div class="method-source-code" id="M000019-source">
|
2200
1884
|
<pre>
|
2201
1885
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 220</span>
|
2202
1886
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">value=</span>(<span class="ruby-identifier">value</span>)
|
@@ -2205,38 +1889,30 @@ A convenience method that sets the first value in the value list. See
|
|
2205
1889
|
<span class="ruby-keyword kw">end</span>
|
2206
1890
|
</pre>
|
2207
1891
|
</div>
|
2208
|
-
|
2209
1892
|
</div>
|
2210
1893
|
</div>
|
2211
1894
|
|
2212
|
-
|
2213
|
-
|
2214
|
-
<a name="M000058"></a>
|
1895
|
+
<div id="method-M000033" class="method-detail">
|
1896
|
+
<a name="M000033"></a>
|
2215
1897
|
|
2216
1898
|
<div class="method-heading">
|
2217
|
-
|
2218
|
-
<a href="#M000058" class="method-signature">
|
2219
|
-
|
1899
|
+
<a href="#M000033" class="method-signature">
|
2220
1900
|
<span class="method-name">values</span><span class="method-args">( {|value| ...}</span>
|
2221
|
-
|
2222
1901
|
</a>
|
2223
|
-
|
2224
1902
|
</div>
|
2225
|
-
|
1903
|
+
|
2226
1904
|
<div class="method-description">
|
2227
|
-
|
2228
1905
|
<p>
|
2229
|
-
Returns an Array of the
|
2230
|
-
enumerates them.
|
1906
|
+
Returns an Array of the <a href="Tag.html#M000033">values</a> of this <a
|
1907
|
+
href="Tag.html">Tag</a> or enumerates them.
|
2231
1908
|
</p>
|
2232
1909
|
<pre>
|
2233
1910
|
tag.values # => [123, "spices"]
|
2234
1911
|
tag.values { |value| puts value }
|
2235
1912
|
</pre>
|
2236
|
-
|
2237
1913
|
<p><a class="source-toggle" href="#"
|
2238
|
-
onclick="toggleCode('
|
2239
|
-
<div class="method-source-code" id="
|
1914
|
+
onclick="toggleCode('M000033-source');return false;">[Source]</a></p>
|
1915
|
+
<div class="method-source-code" id="M000033-source">
|
2240
1916
|
<pre>
|
2241
1917
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 447</span>
|
2242
1918
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">values</span> <span class="ruby-comment cmt"># :yields: value</span>
|
@@ -2249,45 +1925,39 @@ enumerates them.
|
|
2249
1925
|
<span class="ruby-keyword kw">end</span>
|
2250
1926
|
</pre>
|
2251
1927
|
</div>
|
2252
|
-
|
2253
1928
|
</div>
|
2254
1929
|
</div>
|
2255
1930
|
|
2256
|
-
|
2257
|
-
|
2258
|
-
<a name="M000059"></a>
|
1931
|
+
<div id="method-M000034" class="method-detail">
|
1932
|
+
<a name="M000034"></a>
|
2259
1933
|
|
2260
1934
|
<div class="method-heading">
|
2261
|
-
|
2262
|
-
<a href="#M000059" class="method-signature">
|
2263
|
-
|
1935
|
+
<a href="#M000034" class="method-signature">
|
2264
1936
|
<span class="method-name">values=</span><span class="method-args">(someValues)</span>
|
2265
|
-
|
2266
1937
|
</a>
|
2267
|
-
|
2268
1938
|
</div>
|
2269
|
-
|
1939
|
+
|
2270
1940
|
<div class="method-description">
|
2271
|
-
|
2272
1941
|
<p>
|
2273
|
-
Set the values for this tag. See {@link
|
2274
|
-
types.
|
1942
|
+
Set the <a href="Tag.html#M000033">values</a> for this tag. See {@link
|
1943
|
+
addValue(Object)} for legal <a href="Tag.html#M000020">value</a> types.
|
2275
1944
|
</p>
|
2276
1945
|
<table>
|
2277
|
-
<tr><td valign="top"><tt>values</tt>:</td><td>The new
|
1946
|
+
<tr><td valign="top"><tt><a href="Tag.html#M000033">values</a></tt>:</td><td>The <a href="Tag.html#M000013">new</a> <a
|
1947
|
+
href="Tag.html#M000033">values</a>
|
2278
1948
|
|
2279
1949
|
</td></tr>
|
2280
1950
|
</table>
|
2281
1951
|
<p>
|
2282
|
-
@throws IllegalArgumentException if the collection contains any
|
1952
|
+
@throws IllegalArgumentException if the collection contains any <a
|
1953
|
+
href="Tag.html#M000033">values</a>
|
2283
1954
|
</p>
|
2284
1955
|
<pre>
|
2285
1956
|
which are not legal SDL types
|
2286
1957
|
</pre>
|
2287
|
-
|
2288
1958
|
<p><a class="source-toggle" href="#"
|
2289
|
-
onclick="toggleCode('
|
2290
|
-
<div class="method-source-code" id="
|
1959
|
+
onclick="toggleCode('M000034-source');return false;">[Source]</a></p>
|
1960
|
+
<div class="method-source-code" id="M000034-source">
|
2291
1961
|
<pre>
|
2292
1962
|
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 463</span>
|
2293
1963
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">values=</span>(<span class="ruby-identifier">someValues</span>)
|
@@ -2300,81 +1970,80 @@ types.
|
|
2300
1970
|
<span class="ruby-keyword kw">end</span>
|
2301
1971
|
</pre>
|
2302
1972
|
</div>
|
2303
|
-
|
2304
1973
|
</div>
|
2305
1974
|
</div>
|
2306
1975
|
|
2307
|
-
|
2308
|
-
|
2309
|
-
<a name="M000072"></a>
|
1976
|
+
<div id="method-M000047" class="method-detail">
|
1977
|
+
<a name="M000047"></a>
|
2310
1978
|
|
2311
1979
|
<div class="method-heading">
|
2312
|
-
|
2313
|
-
<a href="#M000072" class="method-signature">
|
2314
|
-
|
1980
|
+
<a href="#M000047" class="method-signature">
|
2315
1981
|
<span class="method-name">write</span><span class="method-args">(output, include_root = false)</span>
|
2316
|
-
|
2317
1982
|
</a>
|
2318
|
-
|
2319
1983
|
</div>
|
2320
|
-
|
1984
|
+
|
2321
1985
|
<div class="method-description">
|
2322
|
-
|
2323
1986
|
<p>
|
2324
|
-
Write this tag out to the given IO or
|
2325
|
-
root.)
|
1987
|
+
Write this tag out to the given IO or StringIO or String (optionally
|
1988
|
+
clipping the root.) Returns <tt>output</tt>.
|
2326
1989
|
</p>
|
2327
1990
|
<table>
|
2328
|
-
<tr><td valign="top"><tt>
|
1991
|
+
<tr><td valign="top"><tt>output</tt>:</td><td>an IO or StringIO or a String to <a href="Tag.html#M000047">write</a> to
|
2329
1992
|
|
2330
1993
|
</td></tr>
|
2331
|
-
<tr><td valign="top"><tt>
|
1994
|
+
<tr><td valign="top"><tt>include_root</tt>:</td><td>if true this tag will be written out as the root element, if false only the
|
2332
1995
|
|
2333
1996
|
</td></tr>
|
2334
1997
|
</table>
|
2335
1998
|
<pre>
|
2336
|
-
|
1999
|
+
children will be written. False by default.
|
2337
2000
|
</pre>
|
2338
|
-
|
2339
2001
|
<p><a class="source-toggle" href="#"
|
2340
|
-
onclick="toggleCode('
|
2341
|
-
<div class="method-source-code" id="
|
2002
|
+
onclick="toggleCode('M000047-source');return false;">[Source]</a></p>
|
2003
|
+
<div class="method-source-code" id="M000047-source">
|
2342
2004
|
<pre>
|
2343
|
-
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line
|
2005
|
+
<span class="ruby-comment cmt"># File lib/sdl4r/tag.rb, line 732</span>
|
2344
2006
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write</span>(<span class="ruby-identifier">output</span>, <span class="ruby-identifier">include_root</span> = <span class="ruby-keyword kw">false</span>)
|
2345
|
-
<span class="ruby-
|
2007
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">output</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">String</span>
|
2008
|
+
<span class="ruby-identifier">io</span> = <span class="ruby-constant">StringIO</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">output</span>)
|
2009
|
+
<span class="ruby-identifier">close_io</span> = <span class="ruby-keyword kw">true</span> <span class="ruby-comment cmt"># indicates we close the IO ourselves</span>
|
2010
|
+
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">output</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">IO</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">output</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">StringIO</span>
|
2011
|
+
<span class="ruby-identifier">io</span> = <span class="ruby-identifier">output</span>
|
2012
|
+
<span class="ruby-identifier">close_io</span> = <span class="ruby-keyword kw">false</span> <span class="ruby-comment cmt"># let the caller close the IO</span>
|
2013
|
+
<span class="ruby-keyword kw">else</span>
|
2014
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">"'output' should be a String or an IO but was #{output.class}"</span>
|
2015
|
+
<span class="ruby-keyword kw">end</span>
|
2346
2016
|
|
2347
2017
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">include_root</span>
|
2348
2018
|
<span class="ruby-identifier">io</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">to_s</span>
|
2349
2019
|
<span class="ruby-keyword kw">else</span>
|
2350
|
-
<span class="ruby-identifier">
|
2351
|
-
|
2352
|
-
<span class="ruby-identifier">
|
2020
|
+
<span class="ruby-identifier">first</span> = <span class="ruby-keyword kw">true</span>
|
2021
|
+
<span class="ruby-identifier">children</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">child</span><span class="ruby-operator">|</span>
|
2022
|
+
<span class="ruby-identifier">io</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">$/</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">first</span>
|
2023
|
+
<span class="ruby-identifier">first</span> = <span class="ruby-keyword kw">false</span>
|
2024
|
+
<span class="ruby-identifier">io</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">child</span>.<span class="ruby-identifier">to_s</span>
|
2353
2025
|
<span class="ruby-keyword kw">end</span>
|
2354
2026
|
<span class="ruby-keyword kw">end</span>
|
2355
2027
|
|
2356
|
-
<span class="ruby-identifier">io</span>.<span class="ruby-identifier">close</span>()
|
2028
|
+
<span class="ruby-identifier">io</span>.<span class="ruby-identifier">close</span>() <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">close_io</span>
|
2357
2029
|
|
2358
|
-
<span class="ruby-
|
2030
|
+
<span class="ruby-identifier">output</span>
|
2359
2031
|
<span class="ruby-keyword kw">end</span>
|
2360
2032
|
</pre>
|
2361
2033
|
</div>
|
2362
|
-
|
2363
2034
|
</div>
|
2364
2035
|
</div>
|
2365
2036
|
|
2366
2037
|
|
2367
|
-
|
2368
2038
|
</div>
|
2369
2039
|
|
2370
2040
|
|
2371
|
-
|
2372
|
-
|
2373
2041
|
</div>
|
2374
2042
|
|
2043
|
+
|
2375
2044
|
<div id="validator-badges">
|
2376
2045
|
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
2377
2046
|
</div>
|
2378
2047
|
|
2379
2048
|
</body>
|
2380
|
-
</html>
|
2049
|
+
</html>
|