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