rrtf 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +31 -7
- data/documentation/RRTF/CharacterFormatting.html +1002 -0
- data/documentation/RRTF/CharacterStyle.html +1058 -0
- data/documentation/RRTF/Colour.html +813 -0
- data/documentation/RRTF/ColourTable.html +770 -0
- data/documentation/RRTF/CommandNode.html +2372 -0
- data/documentation/RRTF/ContainerNode.html +826 -0
- data/documentation/RRTF/Converters/HTML/Helpers.html +272 -0
- data/documentation/RRTF/Converters/HTML/Node.html +364 -0
- data/documentation/RRTF/Converters/HTML/NodeSet.html +265 -0
- data/documentation/RRTF/Converters/HTML.html +337 -0
- data/documentation/RRTF/Converters.html +117 -0
- data/documentation/RRTF/Document.html +2405 -0
- data/documentation/RRTF/DocumentStyle.html +1367 -0
- data/documentation/RRTF/Font.html +790 -0
- data/documentation/RRTF/FontTable.html +763 -0
- data/documentation/RRTF/FooterNode.html +515 -0
- data/documentation/RRTF/HeaderNode.html +515 -0
- data/documentation/RRTF/ImageNode.html +1374 -0
- data/documentation/RRTF/Information.html +809 -0
- data/documentation/RRTF/LinkNode.html +264 -0
- data/documentation/RRTF/ListLevel.html +799 -0
- data/documentation/RRTF/ListLevelNode.html +612 -0
- data/documentation/RRTF/ListMarker.html +595 -0
- data/documentation/RRTF/ListNode.html +368 -0
- data/documentation/RRTF/ListTable.html +343 -0
- data/documentation/RRTF/ListTemplate.html +433 -0
- data/documentation/RRTF/ListTextNode.html +285 -0
- data/documentation/RRTF/Node.html +616 -0
- data/documentation/RRTF/Paper.html +624 -0
- data/documentation/RRTF/ParagraphFormatting.html +749 -0
- data/documentation/RRTF/ParagraphNode.html +275 -0
- data/documentation/RRTF/ParagraphStyle.html +1319 -0
- data/documentation/RRTF/RTFError.html +295 -0
- data/documentation/RRTF/Style.html +1767 -0
- data/documentation/RRTF/Stylesheet.html +1768 -0
- data/documentation/RRTF/TableCellNode.html +1704 -0
- data/documentation/RRTF/TableNode.html +1025 -0
- data/documentation/RRTF/TableRowNode.html +675 -0
- data/documentation/RRTF/TextNode.html +600 -0
- data/documentation/RRTF/Utilities.html +201 -0
- data/documentation/RRTF.html +129 -0
- data/documentation/_index.html +478 -0
- data/documentation/class_list.html +51 -0
- data/documentation/css/common.css +1 -0
- data/documentation/css/full_list.css +58 -0
- data/documentation/css/style.css +492 -0
- data/documentation/file.README.html +223 -0
- data/documentation/file_list.html +56 -0
- data/documentation/frames.html +17 -0
- data/documentation/index.html +223 -0
- data/documentation/js/app.js +248 -0
- data/documentation/js/full_list.js +216 -0
- data/documentation/js/jquery.js +4 -0
- data/documentation/method_list.html +2203 -0
- data/documentation/top-level-namespace.html +110 -0
- data/examples/01.rtf +14 -17
- data/examples/01_mac_word15_36.png +0 -0
- data/examples/01_styles_and_paragraphs.rb +3 -4
- data/examples/resources/json/redshirt_styles.json +4 -2
- data/lib/rrtf/node.rb +86 -167
- data/lib/rrtf/style/character_style.rb +4 -3
- data/lib/rrtf/style/formatting.rb +55 -11
- data/lib/rrtf/style/paragraph_style.rb +19 -4
- data/lib/rrtf/style/style.rb +15 -15
- data/lib/rrtf/stylesheet.rb +57 -16
- data/lib/rrtf/version.rb +1 -1
- data/rrtf.gemspec +1 -0
- metadata +70 -1
@@ -0,0 +1,770 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: RRTF::ColourTable
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.9
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "RRTF::ColourTable";
|
19
|
+
relpath = '../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../_index.html">Index (C)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../RRTF.html" title="RRTF (module)">RRTF</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">ColourTable</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Class: RRTF::ColourTable
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">Object</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">RRTF::ColourTable</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<dl>
|
96
|
+
<dt>Defined in:</dt>
|
97
|
+
<dd>lib/rrtf/colour.rb</dd>
|
98
|
+
</dl>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
|
105
|
+
<p>This class represents a table of colours used within a RTF document. This
|
106
|
+
class need not be directly instantiated as it will be used internally by,
|
107
|
+
and can be obtained from a Document object.</p>
|
108
|
+
|
109
|
+
|
110
|
+
</div>
|
111
|
+
</div>
|
112
|
+
<div class="tags">
|
113
|
+
|
114
|
+
|
115
|
+
</div>
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
<h2>
|
124
|
+
Instance Method Summary
|
125
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
126
|
+
</h2>
|
127
|
+
|
128
|
+
<ul class="summary">
|
129
|
+
|
130
|
+
<li class="public ">
|
131
|
+
<span class="summary_signature">
|
132
|
+
|
133
|
+
<a href="#[]-instance_method" title="#[] (instance method)">#<strong>[]</strong>(index) ⇒ Object </a>
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
</span>
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
<span class="summary_desc"><div class='inline'>
|
148
|
+
<p>This method overloads the array dereference operator for the ColourTable
|
149
|
+
class.</p>
|
150
|
+
</div></span>
|
151
|
+
|
152
|
+
</li>
|
153
|
+
|
154
|
+
|
155
|
+
<li class="public ">
|
156
|
+
<span class="summary_signature">
|
157
|
+
|
158
|
+
<a href="#add-instance_method" title="#add (instance method)">#<strong>add</strong>(colour) ⇒ Object </a>
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
(also: #<<)
|
163
|
+
|
164
|
+
</span>
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
<span class="summary_desc"><div class='inline'>
|
175
|
+
<p>This method adds a new colour to a ColourTable object.</p>
|
176
|
+
</div></span>
|
177
|
+
|
178
|
+
</li>
|
179
|
+
|
180
|
+
|
181
|
+
<li class="public ">
|
182
|
+
<span class="summary_signature">
|
183
|
+
|
184
|
+
<a href="#each-instance_method" title="#each (instance method)">#<strong>each</strong> ⇒ Object </a>
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
</span>
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
<span class="summary_desc"><div class='inline'>
|
199
|
+
<p>This method iterates over the contents of a ColourTable object.</p>
|
200
|
+
</div></span>
|
201
|
+
|
202
|
+
</li>
|
203
|
+
|
204
|
+
|
205
|
+
<li class="public ">
|
206
|
+
<span class="summary_signature">
|
207
|
+
|
208
|
+
<a href="#index-instance_method" title="#index (instance method)">#<strong>index</strong>(colour) ⇒ Object </a>
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
</span>
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
<span class="summary_desc"><div class='inline'>
|
223
|
+
<p>This method retrieves the index of a specified colour within the table.</p>
|
224
|
+
</div></span>
|
225
|
+
|
226
|
+
</li>
|
227
|
+
|
228
|
+
|
229
|
+
<li class="public ">
|
230
|
+
<span class="summary_signature">
|
231
|
+
|
232
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(*colours) ⇒ ColourTable </a>
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
</span>
|
237
|
+
|
238
|
+
|
239
|
+
<span class="note title constructor">constructor</span>
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
<span class="summary_desc"><div class='inline'>
|
249
|
+
<p>This is the constructor for the ColourTable class.</p>
|
250
|
+
</div></span>
|
251
|
+
|
252
|
+
</li>
|
253
|
+
|
254
|
+
|
255
|
+
<li class="public ">
|
256
|
+
<span class="summary_signature">
|
257
|
+
|
258
|
+
<a href="#size-instance_method" title="#size (instance method)">#<strong>size</strong> ⇒ Object </a>
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
</span>
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
<span class="summary_desc"><div class='inline'>
|
273
|
+
<p>This method fetches a count of the number of colours within a colour table.</p>
|
274
|
+
</div></span>
|
275
|
+
|
276
|
+
</li>
|
277
|
+
|
278
|
+
|
279
|
+
<li class="public ">
|
280
|
+
<span class="summary_signature">
|
281
|
+
|
282
|
+
<a href="#to_rtf-instance_method" title="#to_rtf (instance method)">#<strong>to_rtf</strong>(indent = 0) ⇒ Object </a>
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
</span>
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
<span class="summary_desc"><div class='inline'>
|
297
|
+
<p>This method generates the RTF text for a ColourTable object.</p>
|
298
|
+
</div></span>
|
299
|
+
|
300
|
+
</li>
|
301
|
+
|
302
|
+
|
303
|
+
<li class="public ">
|
304
|
+
<span class="summary_signature">
|
305
|
+
|
306
|
+
<a href="#to_s-instance_method" title="#to_s (instance method)">#<strong>to_s</strong>(indent = 0) ⇒ Object </a>
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
</span>
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
|
320
|
+
<span class="summary_desc"><div class='inline'>
|
321
|
+
<p>This method generates a textual description for a ColourTable object.</p>
|
322
|
+
</div></span>
|
323
|
+
|
324
|
+
</li>
|
325
|
+
|
326
|
+
|
327
|
+
</ul>
|
328
|
+
|
329
|
+
|
330
|
+
<div id="constructor_details" class="method_details_list">
|
331
|
+
<h2>Constructor Details</h2>
|
332
|
+
|
333
|
+
<div class="method_details first">
|
334
|
+
<h3 class="signature first" id="initialize-instance_method">
|
335
|
+
|
336
|
+
#<strong>initialize</strong>(*colours) ⇒ <tt><span class='object_link'><a href="" title="RRTF::ColourTable (class)">ColourTable</a></span></tt>
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
</h3><div class="docstring">
|
343
|
+
<div class="discussion">
|
344
|
+
|
345
|
+
<p>This is the constructor for the ColourTable class.</p>
|
346
|
+
|
347
|
+
<h4 id="label-Parameters">Parameters</h4>
|
348
|
+
<dl class="rdoc-list note-list"><dt>*colours
|
349
|
+
<dd>
|
350
|
+
<p>An array of zero or more colours that make up the colour table entries.</p>
|
351
|
+
</dd></dl>
|
352
|
+
|
353
|
+
|
354
|
+
</div>
|
355
|
+
</div>
|
356
|
+
<div class="tags">
|
357
|
+
|
358
|
+
|
359
|
+
</div><table class="source_code">
|
360
|
+
<tr>
|
361
|
+
<td>
|
362
|
+
<pre class="lines">
|
363
|
+
|
364
|
+
|
365
|
+
95
|
366
|
+
96
|
367
|
+
97
|
368
|
+
98</pre>
|
369
|
+
</td>
|
370
|
+
<td>
|
371
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/colour.rb', line 95</span>
|
372
|
+
|
373
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_colours'>colours</span><span class='rparen'>)</span>
|
374
|
+
<span class='ivar'>@colours</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
375
|
+
<span class='id identifier rubyid_colours'>colours</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_colour'>colour</span><span class='op'>|</span> <span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='id identifier rubyid_colour'>colour</span><span class='rparen'>)</span><span class='rbrace'>}</span>
|
376
|
+
<span class='kw'>end</span></pre>
|
377
|
+
</td>
|
378
|
+
</tr>
|
379
|
+
</table>
|
380
|
+
</div>
|
381
|
+
|
382
|
+
</div>
|
383
|
+
|
384
|
+
|
385
|
+
<div id="instance_method_details" class="method_details_list">
|
386
|
+
<h2>Instance Method Details</h2>
|
387
|
+
|
388
|
+
|
389
|
+
<div class="method_details first">
|
390
|
+
<h3 class="signature first" id="[]-instance_method">
|
391
|
+
|
392
|
+
#<strong>[]</strong>(index) ⇒ <tt>Object</tt>
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
|
397
|
+
|
398
|
+
</h3><div class="docstring">
|
399
|
+
<div class="discussion">
|
400
|
+
|
401
|
+
<p>This method overloads the array dereference operator for the ColourTable
|
402
|
+
class. It is not possible to dereference the implicit default colour using
|
403
|
+
this method. An invalid index will return a nil value.</p>
|
404
|
+
|
405
|
+
<h4 id="label-Parameters">Parameters</h4>
|
406
|
+
<dl class="rdoc-list note-list"><dt>index
|
407
|
+
<dd>
|
408
|
+
<p>The index of the colour to be retrieved.</p>
|
409
|
+
</dd></dl>
|
410
|
+
|
411
|
+
|
412
|
+
</div>
|
413
|
+
</div>
|
414
|
+
<div class="tags">
|
415
|
+
|
416
|
+
|
417
|
+
</div><table class="source_code">
|
418
|
+
<tr>
|
419
|
+
<td>
|
420
|
+
<pre class="lines">
|
421
|
+
|
422
|
+
|
423
|
+
133
|
424
|
+
134
|
425
|
+
135</pre>
|
426
|
+
</td>
|
427
|
+
<td>
|
428
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/colour.rb', line 133</span>
|
429
|
+
|
430
|
+
<span class='kw'>def</span> <span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_index'>index</span><span class='rparen'>)</span>
|
431
|
+
<span class='ivar'>@colours</span><span class='lbracket'>[</span><span class='id identifier rubyid_index'>index</span><span class='rbracket'>]</span>
|
432
|
+
<span class='kw'>end</span></pre>
|
433
|
+
</td>
|
434
|
+
</tr>
|
435
|
+
</table>
|
436
|
+
</div>
|
437
|
+
|
438
|
+
<div class="method_details ">
|
439
|
+
<h3 class="signature " id="add-instance_method">
|
440
|
+
|
441
|
+
#<strong>add</strong>(colour) ⇒ <tt>Object</tt>
|
442
|
+
|
443
|
+
|
444
|
+
|
445
|
+
<span class="aliases">Also known as:
|
446
|
+
<span class="names"><span id='<<-instance_method'><<</span></span>
|
447
|
+
</span>
|
448
|
+
|
449
|
+
|
450
|
+
|
451
|
+
</h3><div class="docstring">
|
452
|
+
<div class="discussion">
|
453
|
+
|
454
|
+
<p>This method adds a new colour to a ColourTable object. If the colour
|
455
|
+
already exists within the table or is not a Colour object then this method
|
456
|
+
does nothing.</p>
|
457
|
+
|
458
|
+
<h4 id="label-Parameters">Parameters</h4>
|
459
|
+
<dl class="rdoc-list note-list"><dt>colour
|
460
|
+
<dd>
|
461
|
+
<p>The colour to be added to the table.</p>
|
462
|
+
</dd></dl>
|
463
|
+
|
464
|
+
|
465
|
+
</div>
|
466
|
+
</div>
|
467
|
+
<div class="tags">
|
468
|
+
|
469
|
+
|
470
|
+
</div><table class="source_code">
|
471
|
+
<tr>
|
472
|
+
<td>
|
473
|
+
<pre class="lines">
|
474
|
+
|
475
|
+
|
476
|
+
112
|
477
|
+
113
|
478
|
+
114
|
479
|
+
115
|
480
|
+
116
|
481
|
+
117</pre>
|
482
|
+
</td>
|
483
|
+
<td>
|
484
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/colour.rb', line 112</span>
|
485
|
+
|
486
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_add'>add</span><span class='lparen'>(</span><span class='id identifier rubyid_colour'>colour</span><span class='rparen'>)</span>
|
487
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_colour'>colour</span><span class='period'>.</span><span class='id identifier rubyid_instance_of?'>instance_of?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Colour.html" title="RRTF::Colour (class)">Colour</a></span></span><span class='rparen'>)</span>
|
488
|
+
<span class='ivar'>@colours</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_colour'>colour</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='ivar'>@colours</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span><span class='lparen'>(</span><span class='id identifier rubyid_colour'>colour</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
489
|
+
<span class='kw'>end</span>
|
490
|
+
<span class='kw'>self</span>
|
491
|
+
<span class='kw'>end</span></pre>
|
492
|
+
</td>
|
493
|
+
</tr>
|
494
|
+
</table>
|
495
|
+
</div>
|
496
|
+
|
497
|
+
<div class="method_details ">
|
498
|
+
<h3 class="signature " id="each-instance_method">
|
499
|
+
|
500
|
+
#<strong>each</strong> ⇒ <tt>Object</tt>
|
501
|
+
|
502
|
+
|
503
|
+
|
504
|
+
|
505
|
+
|
506
|
+
</h3><div class="docstring">
|
507
|
+
<div class="discussion">
|
508
|
+
|
509
|
+
<p>This method iterates over the contents of a ColourTable object. This
|
510
|
+
iteration does not include the implicit default colour entry.</p>
|
511
|
+
|
512
|
+
|
513
|
+
</div>
|
514
|
+
</div>
|
515
|
+
<div class="tags">
|
516
|
+
|
517
|
+
|
518
|
+
</div><table class="source_code">
|
519
|
+
<tr>
|
520
|
+
<td>
|
521
|
+
<pre class="lines">
|
522
|
+
|
523
|
+
|
524
|
+
121
|
525
|
+
122
|
526
|
+
123
|
527
|
+
124
|
528
|
+
125</pre>
|
529
|
+
</td>
|
530
|
+
<td>
|
531
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/colour.rb', line 121</span>
|
532
|
+
|
533
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_each'>each</span>
|
534
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
|
535
|
+
<span class='ivar'>@colours</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_colour'>colour</span><span class='op'>|</span> <span class='kw'>yield</span> <span class='id identifier rubyid_colour'>colour</span><span class='rbrace'>}</span>
|
536
|
+
<span class='kw'>end</span>
|
537
|
+
<span class='kw'>end</span></pre>
|
538
|
+
</td>
|
539
|
+
</tr>
|
540
|
+
</table>
|
541
|
+
</div>
|
542
|
+
|
543
|
+
<div class="method_details ">
|
544
|
+
<h3 class="signature " id="index-instance_method">
|
545
|
+
|
546
|
+
#<strong>index</strong>(colour) ⇒ <tt>Object</tt>
|
547
|
+
|
548
|
+
|
549
|
+
|
550
|
+
|
551
|
+
|
552
|
+
</h3><div class="docstring">
|
553
|
+
<div class="discussion">
|
554
|
+
|
555
|
+
<p>This method retrieves the index of a specified colour within the table. If
|
556
|
+
the colour doesn't exist within the table then nil is returned. It
|
557
|
+
should be noted that the index of a colour will be one more than its order
|
558
|
+
of entry to account for the implicit default colour entry.</p>
|
559
|
+
|
560
|
+
<h4 id="label-Parameters">Parameters</h4>
|
561
|
+
<dl class="rdoc-list note-list"><dt>colour
|
562
|
+
<dd>
|
563
|
+
<p>The colour to retrieve the index of.</p>
|
564
|
+
</dd></dl>
|
565
|
+
|
566
|
+
|
567
|
+
</div>
|
568
|
+
</div>
|
569
|
+
<div class="tags">
|
570
|
+
|
571
|
+
|
572
|
+
</div><table class="source_code">
|
573
|
+
<tr>
|
574
|
+
<td>
|
575
|
+
<pre class="lines">
|
576
|
+
|
577
|
+
|
578
|
+
144
|
579
|
+
145
|
580
|
+
146
|
581
|
+
147</pre>
|
582
|
+
</td>
|
583
|
+
<td>
|
584
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/colour.rb', line 144</span>
|
585
|
+
|
586
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_index'>index</span><span class='lparen'>(</span><span class='id identifier rubyid_colour'>colour</span><span class='rparen'>)</span>
|
587
|
+
<span class='id identifier rubyid_index'>index</span> <span class='op'>=</span> <span class='ivar'>@colours</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span><span class='lparen'>(</span><span class='id identifier rubyid_colour'>colour</span><span class='rparen'>)</span>
|
588
|
+
<span class='id identifier rubyid_index'>index</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='id identifier rubyid_index'>index</span> <span class='op'>:</span> <span class='id identifier rubyid_index'>index</span> <span class='op'>+</span> <span class='int'>1</span>
|
589
|
+
<span class='kw'>end</span></pre>
|
590
|
+
</td>
|
591
|
+
</tr>
|
592
|
+
</table>
|
593
|
+
</div>
|
594
|
+
|
595
|
+
<div class="method_details ">
|
596
|
+
<h3 class="signature " id="size-instance_method">
|
597
|
+
|
598
|
+
#<strong>size</strong> ⇒ <tt>Object</tt>
|
599
|
+
|
600
|
+
|
601
|
+
|
602
|
+
|
603
|
+
|
604
|
+
</h3><div class="docstring">
|
605
|
+
<div class="discussion">
|
606
|
+
|
607
|
+
<p>This method fetches a count of the number of colours within a colour table.</p>
|
608
|
+
|
609
|
+
|
610
|
+
</div>
|
611
|
+
</div>
|
612
|
+
<div class="tags">
|
613
|
+
|
614
|
+
|
615
|
+
</div><table class="source_code">
|
616
|
+
<tr>
|
617
|
+
<td>
|
618
|
+
<pre class="lines">
|
619
|
+
|
620
|
+
|
621
|
+
102
|
622
|
+
103
|
623
|
+
104</pre>
|
624
|
+
</td>
|
625
|
+
<td>
|
626
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/colour.rb', line 102</span>
|
627
|
+
|
628
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_size'>size</span>
|
629
|
+
<span class='ivar'>@colours</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span>
|
630
|
+
<span class='kw'>end</span></pre>
|
631
|
+
</td>
|
632
|
+
</tr>
|
633
|
+
</table>
|
634
|
+
</div>
|
635
|
+
|
636
|
+
<div class="method_details ">
|
637
|
+
<h3 class="signature " id="to_rtf-instance_method">
|
638
|
+
|
639
|
+
#<strong>to_rtf</strong>(indent = 0) ⇒ <tt>Object</tt>
|
640
|
+
|
641
|
+
|
642
|
+
|
643
|
+
|
644
|
+
|
645
|
+
</h3><div class="docstring">
|
646
|
+
<div class="discussion">
|
647
|
+
|
648
|
+
<p>This method generates the RTF text for a ColourTable object.</p>
|
649
|
+
|
650
|
+
<h4 id="label-Parameters">Parameters</h4>
|
651
|
+
<dl class="rdoc-list note-list"><dt>indent
|
652
|
+
<dd>
|
653
|
+
<p>The number of spaces to prefix to the lines generated by the method.
|
654
|
+
Defaults to zero.</p>
|
655
|
+
</dd></dl>
|
656
|
+
|
657
|
+
|
658
|
+
</div>
|
659
|
+
</div>
|
660
|
+
<div class="tags">
|
661
|
+
|
662
|
+
|
663
|
+
</div><table class="source_code">
|
664
|
+
<tr>
|
665
|
+
<td>
|
666
|
+
<pre class="lines">
|
667
|
+
|
668
|
+
|
669
|
+
169
|
670
|
+
170
|
671
|
+
171
|
672
|
+
172
|
673
|
+
173
|
674
|
+
174
|
675
|
+
175
|
676
|
+
176
|
677
|
+
177
|
678
|
+
178</pre>
|
679
|
+
</td>
|
680
|
+
<td>
|
681
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/colour.rb', line 169</span>
|
682
|
+
|
683
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_rtf'>to_rtf</span><span class='lparen'>(</span><span class='id identifier rubyid_indent'>indent</span><span class='op'>=</span><span class='int'>0</span><span class='rparen'>)</span>
|
684
|
+
<span class='id identifier rubyid_prefix'>prefix</span> <span class='op'>=</span> <span class='id identifier rubyid_indent'>indent</span> <span class='op'>></span> <span class='int'>0</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> </span><span class='tstring_end'>'</span></span> <span class='op'>*</span> <span class='id identifier rubyid_indent'>indent</span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span>
|
685
|
+
<span class='id identifier rubyid_text'>text</span> <span class='op'>=</span> <span class='const'>StringIO</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
686
|
+
|
687
|
+
<span class='id identifier rubyid_text'>text</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_prefix'>prefix</span><span class='embexpr_end'>}</span><span class='tstring_content'>{\\colortbl\n</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_prefix'>prefix</span><span class='embexpr_end'>}</span><span class='tstring_content'>;</span><span class='tstring_end'>"</span></span>
|
688
|
+
<span class='ivar'>@colours</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_colour'>colour</span><span class='op'>|</span> <span class='id identifier rubyid_text'>text</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_prefix'>prefix</span><span class='embexpr_end'>}</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_colour'>colour</span><span class='period'>.</span><span class='id identifier rubyid_to_rtf'>to_rtf</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rbrace'>}</span>
|
689
|
+
<span class='id identifier rubyid_text'>text</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_prefix'>prefix</span><span class='embexpr_end'>}</span><span class='tstring_content'>}</span><span class='tstring_end'>"</span></span>
|
690
|
+
|
691
|
+
<span class='id identifier rubyid_text'>text</span><span class='period'>.</span><span class='id identifier rubyid_string'>string</span>
|
692
|
+
<span class='kw'>end</span></pre>
|
693
|
+
</td>
|
694
|
+
</tr>
|
695
|
+
</table>
|
696
|
+
</div>
|
697
|
+
|
698
|
+
<div class="method_details ">
|
699
|
+
<h3 class="signature " id="to_s-instance_method">
|
700
|
+
|
701
|
+
#<strong>to_s</strong>(indent = 0) ⇒ <tt>Object</tt>
|
702
|
+
|
703
|
+
|
704
|
+
|
705
|
+
|
706
|
+
|
707
|
+
</h3><div class="docstring">
|
708
|
+
<div class="discussion">
|
709
|
+
|
710
|
+
<p>This method generates a textual description for a ColourTable object.</p>
|
711
|
+
|
712
|
+
<h4 id="label-Parameters">Parameters</h4>
|
713
|
+
<dl class="rdoc-list note-list"><dt>indent
|
714
|
+
<dd>
|
715
|
+
<p>The number of spaces to prefix to the lines generated by the method.
|
716
|
+
Defaults to zero.</p>
|
717
|
+
</dd></dl>
|
718
|
+
|
719
|
+
|
720
|
+
</div>
|
721
|
+
</div>
|
722
|
+
<div class="tags">
|
723
|
+
|
724
|
+
|
725
|
+
</div><table class="source_code">
|
726
|
+
<tr>
|
727
|
+
<td>
|
728
|
+
<pre class="lines">
|
729
|
+
|
730
|
+
|
731
|
+
154
|
732
|
+
155
|
733
|
+
156
|
734
|
+
157
|
735
|
+
158
|
736
|
+
159
|
737
|
+
160
|
738
|
+
161
|
739
|
+
162</pre>
|
740
|
+
</td>
|
741
|
+
<td>
|
742
|
+
<pre class="code"><span class="info file"># File 'lib/rrtf/colour.rb', line 154</span>
|
743
|
+
|
744
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span><span class='lparen'>(</span><span class='id identifier rubyid_indent'>indent</span><span class='op'>=</span><span class='int'>0</span><span class='rparen'>)</span>
|
745
|
+
<span class='id identifier rubyid_prefix'>prefix</span> <span class='op'>=</span> <span class='id identifier rubyid_indent'>indent</span> <span class='op'>></span> <span class='int'>0</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'> </span><span class='tstring_end'>'</span></span> <span class='op'>*</span> <span class='id identifier rubyid_indent'>indent</span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span>
|
746
|
+
<span class='id identifier rubyid_text'>text</span> <span class='op'>=</span> <span class='const'>StringIO</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
747
|
+
|
748
|
+
<span class='id identifier rubyid_text'>text</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_prefix'>prefix</span><span class='embexpr_end'>}</span><span class='tstring_content'>Colour Table (</span><span class='embexpr_beg'>#{</span><span class='ivar'>@colours</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='embexpr_end'>}</span><span class='tstring_content'> colours)</span><span class='tstring_end'>"</span></span>
|
749
|
+
<span class='ivar'>@colours</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_colour'>colour</span><span class='op'>|</span> <span class='id identifier rubyid_text'>text</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_prefix'>prefix</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_colour'>colour</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rbrace'>}</span>
|
750
|
+
|
751
|
+
<span class='id identifier rubyid_text'>text</span><span class='period'>.</span><span class='id identifier rubyid_string'>string</span>
|
752
|
+
<span class='kw'>end</span></pre>
|
753
|
+
</td>
|
754
|
+
</tr>
|
755
|
+
</table>
|
756
|
+
</div>
|
757
|
+
|
758
|
+
</div>
|
759
|
+
|
760
|
+
</div>
|
761
|
+
|
762
|
+
<div id="footer">
|
763
|
+
Generated on Mon Jul 24 15:49:01 2017 by
|
764
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
765
|
+
0.9.9 (ruby-2.3.3).
|
766
|
+
</div>
|
767
|
+
|
768
|
+
</div>
|
769
|
+
</body>
|
770
|
+
</html>
|