workbook 0.4.13 → 0.4.14
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/.gitignore +2 -1
- data/lib/workbook/modules/cell.rb +14 -0
- data/lib/workbook/version.rb +1 -1
- data/test/test_modules_cache.rb +14 -14
- data/test/test_modules_cell.rb +9 -2
- data/test/test_readers_xls_reader.rb +1 -1
- metadata +4 -46
- data/doc/RubyXL/Cell.html +0 -201
- data/doc/RubyXL/Workbook.html +0 -449
- data/doc/RubyXL.html +0 -128
- data/doc/Workbook/Book.html +0 -1852
- data/doc/Workbook/Cell.html +0 -1553
- data/doc/Workbook/Format.html +0 -1168
- data/doc/Workbook/Modules/RawObjectsStorage.html +0 -502
- data/doc/Workbook/Modules/TableDiffSort.html +0 -758
- data/doc/Workbook/Modules/TypeParser.html +0 -1063
- data/doc/Workbook/Modules.html +0 -117
- data/doc/Workbook/NilValue.html +0 -434
- data/doc/Workbook/Readers/CsvReader.html +0 -324
- data/doc/Workbook/Readers/OdsReader.html +0 -1066
- data/doc/Workbook/Readers/TxtReader.html +0 -236
- data/doc/Workbook/Readers/XlsReader.html +0 -378
- data/doc/Workbook/Readers/XlsShared.html +0 -188
- data/doc/Workbook/Readers/XlsxReader.html +0 -302
- data/doc/Workbook/Readers.html +0 -117
- data/doc/Workbook/Row.html +0 -2392
- data/doc/Workbook/Sheet.html +0 -875
- data/doc/Workbook/Table.html +0 -1732
- data/doc/Workbook/Template.html +0 -634
- data/doc/Workbook/Writers/CsvTableWriter.html +0 -200
- data/doc/Workbook/Writers/HtmlWriter.html +0 -407
- data/doc/Workbook/Writers/XlsWriter.html +0 -905
- data/doc/Workbook/Writers.html +0 -117
- data/doc/Workbook.html +0 -142
- data/doc/_index.html +0 -381
- data/doc/class_list.html +0 -53
- data/doc/css/common.css +0 -1
- data/doc/css/full_list.css +0 -57
- data/doc/css/style.css +0 -338
- data/doc/file.README.html +0 -245
- data/doc/file_list.html +0 -55
- data/doc/frames.html +0 -28
- data/doc/index.html +0 -245
- data/doc/js/app.js +0 -214
- data/doc/js/full_list.js +0 -173
- data/doc/js/jquery.js +0 -4
- data/doc/method_list.html +0 -1308
- data/doc/top-level-namespace.html +0 -112
- data/test/artifacts/floats_problem.xls +0 -0
data/doc/Workbook/Row.html
DELETED
@@ -1,2392 +0,0 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
-
<head>
|
5
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
-
<title>
|
7
|
-
Class: Workbook::Row
|
8
|
-
|
9
|
-
— Documentation by YARD 0.8.5.2
|
10
|
-
|
11
|
-
</title>
|
12
|
-
|
13
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
-
|
15
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
-
|
17
|
-
<script type="text/javascript" charset="utf-8">
|
18
|
-
hasFrames = window.top.frames.main ? true : false;
|
19
|
-
relpath = '../';
|
20
|
-
framesUrl = "../frames.html#!" + escape(window.location.href);
|
21
|
-
</script>
|
22
|
-
|
23
|
-
|
24
|
-
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
25
|
-
|
26
|
-
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
27
|
-
|
28
|
-
|
29
|
-
</head>
|
30
|
-
<body>
|
31
|
-
<div id="header">
|
32
|
-
<div id="menu">
|
33
|
-
|
34
|
-
<a href="../_index.html">Index (R)</a> »
|
35
|
-
<span class='title'><span class='object_link'><a href="../Workbook.html" title="Workbook (module)">Workbook</a></span></span>
|
36
|
-
»
|
37
|
-
<span class="title">Row</span>
|
38
|
-
|
39
|
-
|
40
|
-
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
-
</div>
|
42
|
-
|
43
|
-
<div id="search">
|
44
|
-
|
45
|
-
<a class="full_list_link" id="class_list_link"
|
46
|
-
href="../class_list.html">
|
47
|
-
Class List
|
48
|
-
</a>
|
49
|
-
|
50
|
-
<a class="full_list_link" id="method_list_link"
|
51
|
-
href="../method_list.html">
|
52
|
-
Method List
|
53
|
-
</a>
|
54
|
-
|
55
|
-
<a class="full_list_link" id="file_list_link"
|
56
|
-
href="../file_list.html">
|
57
|
-
File List
|
58
|
-
</a>
|
59
|
-
|
60
|
-
</div>
|
61
|
-
<div class="clear"></div>
|
62
|
-
</div>
|
63
|
-
|
64
|
-
<iframe id="search_frame"></iframe>
|
65
|
-
|
66
|
-
<div id="content"><h1>Class: Workbook::Row
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
</h1>
|
71
|
-
|
72
|
-
<dl class="box">
|
73
|
-
|
74
|
-
<dt class="r1">Inherits:</dt>
|
75
|
-
<dd class="r1">
|
76
|
-
<span class="inheritName">Array</span>
|
77
|
-
|
78
|
-
<ul class="fullTree">
|
79
|
-
<li>Object</li>
|
80
|
-
|
81
|
-
<li class="next">Array</li>
|
82
|
-
|
83
|
-
<li class="next">Workbook::Row</li>
|
84
|
-
|
85
|
-
</ul>
|
86
|
-
<a href="#" class="inheritanceTree">show all</a>
|
87
|
-
|
88
|
-
</dd>
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
<dt class="r2 last">Defined in:</dt>
|
99
|
-
<dd class="r2 last">lib/workbook/row.rb</dd>
|
100
|
-
|
101
|
-
</dl>
|
102
|
-
<div class="clear"></div>
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
109
|
-
<ul class="summary">
|
110
|
-
|
111
|
-
<li class="public ">
|
112
|
-
<span class="summary_signature">
|
113
|
-
|
114
|
-
<a href="#format-instance_method" title="#format (instance method)">- (Object) <strong>format</strong> </a>
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
</span>
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
<span class="summary_desc"><div class='inline'>
|
132
|
-
<p>Returns the value of attribute format.</p>
|
133
|
-
</div></span>
|
134
|
-
|
135
|
-
</li>
|
136
|
-
|
137
|
-
|
138
|
-
<li class="public ">
|
139
|
-
<span class="summary_signature">
|
140
|
-
|
141
|
-
<a href="#placeholder-instance_method" title="#placeholder (instance method)">- (Object) <strong>placeholder</strong> </a>
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
</span>
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
<span class="summary_desc"><div class='inline'>
|
159
|
-
<p>The placeholder attribute is used in compares (corresponds to newly created
|
160
|
-
or removed lines (depending which side you're on).</p>
|
161
|
-
</div></span>
|
162
|
-
|
163
|
-
</li>
|
164
|
-
|
165
|
-
|
166
|
-
</ul>
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
<h2>
|
173
|
-
Instance Method Summary
|
174
|
-
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
175
|
-
</h2>
|
176
|
-
|
177
|
-
<ul class="summary">
|
178
|
-
|
179
|
-
<li class="public ">
|
180
|
-
<span class="summary_signature">
|
181
|
-
|
182
|
-
<a href="#%3C%3D%3E-instance_method" title="#<=> (instance method)">- (Workbook::Row) <strong><=></strong>(other) </a>
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
</span>
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
<span class="summary_desc"><div class='inline'>
|
197
|
-
<p>Compares one row wiht another.</p>
|
198
|
-
</div></span>
|
199
|
-
|
200
|
-
</li>
|
201
|
-
|
202
|
-
|
203
|
-
<li class="public ">
|
204
|
-
<span class="summary_signature">
|
205
|
-
|
206
|
-
<a href="#%5B%5D-instance_method" title="#[] (instance method)">- (Workbook::Cell<sup>?</sup>) <strong>[]</strong>(index_or_hash) </a>
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
</span>
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
<span class="summary_desc"><div class='inline'>
|
221
|
-
<p>Overrides normal Array's []-function with support for symbols that identify
|
222
|
-
a column based on the header-values.</p>
|
223
|
-
</div></span>
|
224
|
-
|
225
|
-
</li>
|
226
|
-
|
227
|
-
|
228
|
-
<li class="public ">
|
229
|
-
<span class="summary_signature">
|
230
|
-
|
231
|
-
<a href="#%5B%5D%3D-instance_method" title="#[]= (instance method)">- (Workbook::Cell<sup>?</sup>) <strong>[]=</strong>(index_or_hash, value) </a>
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
</span>
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
<span class="summary_desc"><div class='inline'>
|
246
|
-
<p>Overrides normal Array's []=-function with support for symbols that
|
247
|
-
identify a column based on the header-values.</p>
|
248
|
-
</div></span>
|
249
|
-
|
250
|
-
</li>
|
251
|
-
|
252
|
-
|
253
|
-
<li class="public ">
|
254
|
-
<span class="summary_signature">
|
255
|
-
|
256
|
-
<a href="#clone-instance_method" title="#clone (instance method)">- (Workbook::Row) <strong>clone</strong> </a>
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
</span>
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
<span class="summary_desc"><div class='inline'>
|
271
|
-
<p>clone the row with together with the cells.</p>
|
272
|
-
</div></span>
|
273
|
-
|
274
|
-
</li>
|
275
|
-
|
276
|
-
|
277
|
-
<li class="public ">
|
278
|
-
<span class="summary_signature">
|
279
|
-
|
280
|
-
<a href="#compact-instance_method" title="#compact (instance method)">- (Object) <strong>compact</strong> </a>
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
</span>
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
<span class="summary_desc"><div class='inline'>
|
295
|
-
<p>Compact detaches the row from the table.</p>
|
296
|
-
</div></span>
|
297
|
-
|
298
|
-
</li>
|
299
|
-
|
300
|
-
|
301
|
-
<li class="public ">
|
302
|
-
<span class="summary_signature">
|
303
|
-
|
304
|
-
<a href="#compare_without_header-instance_method" title="#compare_without_header (instance method)">- (Object) <strong>compare_without_header</strong> </a>
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
</span>
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
319
|
-
|
320
|
-
</li>
|
321
|
-
|
322
|
-
|
323
|
-
<li class="public ">
|
324
|
-
<span class="summary_signature">
|
325
|
-
|
326
|
-
<a href="#find_cells_by_background_color-instance_method" title="#find_cells_by_background_color (instance method)">- (Array<Symbol>, Workbook::Row<Workbook::Cell>) <strong>find_cells_by_background_color</strong>(color = :any, options = {}) </a>
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
</span>
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
<span class="summary_desc"><div class='inline'>
|
341
|
-
<p>Returns an array of cells allows you to find cells by a given color,
|
342
|
-
normally a string containing a hex.</p>
|
343
|
-
</div></span>
|
344
|
-
|
345
|
-
</li>
|
346
|
-
|
347
|
-
|
348
|
-
<li class="public ">
|
349
|
-
<span class="summary_signature">
|
350
|
-
|
351
|
-
<a href="#first%3F-instance_method" title="#first? (instance method)">- (Boolean, NilClass) <strong>first?</strong> </a>
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
</span>
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
<span class="summary_desc"><div class='inline'>
|
366
|
-
<p>Is this the first row in the table.</p>
|
367
|
-
</div></span>
|
368
|
-
|
369
|
-
</li>
|
370
|
-
|
371
|
-
|
372
|
-
<li class="public ">
|
373
|
-
<span class="summary_signature">
|
374
|
-
|
375
|
-
<a href="#header%3F-instance_method" title="#header? (instance method)">- (Boolean) <strong>header?</strong> </a>
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
</span>
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
<span class="summary_desc"><div class='inline'>
|
390
|
-
<p>Returns true when the row belongs to a table and it is the header row
|
391
|
-
(typically the first row).</p>
|
392
|
-
</div></span>
|
393
|
-
|
394
|
-
</li>
|
395
|
-
|
396
|
-
|
397
|
-
<li class="public ">
|
398
|
-
<span class="summary_signature">
|
399
|
-
|
400
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Row) <strong>initialize</strong>(cells = [], table = nil, options = {}) </a>
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
</span>
|
405
|
-
|
406
|
-
|
407
|
-
<span class="note title constructor">constructor</span>
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
<span class="summary_desc"><div class='inline'>
|
417
|
-
<p>Initialize a new row.</p>
|
418
|
-
</div></span>
|
419
|
-
|
420
|
-
</li>
|
421
|
-
|
422
|
-
|
423
|
-
<li class="public ">
|
424
|
-
<span class="summary_signature">
|
425
|
-
|
426
|
-
<a href="#key-instance_method" title="#key (instance method)">- (Workbook::Cell) <strong>key</strong> </a>
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
</span>
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
<span class="summary_desc"><div class='inline'>
|
441
|
-
<p>The first cell of the row is considered to be the key.</p>
|
442
|
-
</div></span>
|
443
|
-
|
444
|
-
</li>
|
445
|
-
|
446
|
-
|
447
|
-
<li class="public ">
|
448
|
-
<span class="summary_signature">
|
449
|
-
|
450
|
-
<a href="#no_values%3F-instance_method" title="#no_values? (instance method)">- (Boolean) <strong>no_values?</strong> </a>
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
</span>
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
<span class="summary_desc"><div class='inline'>
|
465
|
-
<p>Returns true when all the cells in the row have values whose to_s value
|
466
|
-
equals an empty string.</p>
|
467
|
-
</div></span>
|
468
|
-
|
469
|
-
</li>
|
470
|
-
|
471
|
-
|
472
|
-
<li class="public ">
|
473
|
-
<span class="summary_signature">
|
474
|
-
|
475
|
-
<a href="#placeholder%3F-instance_method" title="#placeholder? (instance method)">- (Boolean) <strong>placeholder?</strong> </a>
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
</span>
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
<span class="summary_desc"><div class='inline'>
|
490
|
-
<p>An internal function used in diffs.</p>
|
491
|
-
</div></span>
|
492
|
-
|
493
|
-
</li>
|
494
|
-
|
495
|
-
|
496
|
-
<li class="public ">
|
497
|
-
<span class="summary_signature">
|
498
|
-
|
499
|
-
<a href="#set_table-instance_method" title="#set_table (instance method)">- (Object) <strong>set_table</strong>(t) </a>
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
</span>
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
<span class="summary_desc"><div class='inline'>
|
514
|
-
<p>Set reference to the table this row belongs to without adding the row to
|
515
|
-
the table.</p>
|
516
|
-
</div></span>
|
517
|
-
|
518
|
-
</li>
|
519
|
-
|
520
|
-
|
521
|
-
<li class="public ">
|
522
|
-
<span class="summary_signature">
|
523
|
-
|
524
|
-
<a href="#table-instance_method" title="#table (instance method)">- (Workbook::Table) <strong>table</strong> </a>
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
</span>
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
<span class="summary_desc"><div class='inline'>
|
539
|
-
<p>Returns the table this row belongs to.</p>
|
540
|
-
</div></span>
|
541
|
-
|
542
|
-
</li>
|
543
|
-
|
544
|
-
|
545
|
-
<li class="public ">
|
546
|
-
<span class="summary_signature">
|
547
|
-
|
548
|
-
<a href="#table%3D-instance_method" title="#table= (instance method)">- (Object) <strong>table=</strong>(t) </a>
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
</span>
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
<span class="summary_desc"><div class='inline'>
|
563
|
-
<p>Set reference to the table this row belongs to and add the row to this
|
564
|
-
table.</p>
|
565
|
-
</div></span>
|
566
|
-
|
567
|
-
</li>
|
568
|
-
|
569
|
-
|
570
|
-
<li class="public ">
|
571
|
-
<span class="summary_signature">
|
572
|
-
|
573
|
-
<a href="#table_header_keys-instance_method" title="#table_header_keys (instance method)">- (Object) <strong>table_header_keys</strong> </a>
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
</span>
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
<span class="summary_desc"><div class='inline'></div></span>
|
588
|
-
|
589
|
-
</li>
|
590
|
-
|
591
|
-
|
592
|
-
<li class="public ">
|
593
|
-
<span class="summary_signature">
|
594
|
-
|
595
|
-
<a href="#to_a-instance_method" title="#to_a (instance method)">- (Array<Workbook::Cell>) <strong>to_a</strong> </a>
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
</span>
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
<span class="summary_desc"><div class='inline'>
|
610
|
-
<p>Converts the row to an array of Workbook::Cell's.</p>
|
611
|
-
</div></span>
|
612
|
-
|
613
|
-
</li>
|
614
|
-
|
615
|
-
|
616
|
-
<li class="public ">
|
617
|
-
<span class="summary_signature">
|
618
|
-
|
619
|
-
<a href="#to_hash-instance_method" title="#to_hash (instance method)">- (Hash) <strong>to_hash</strong> </a>
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
</span>
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
<span class="summary_desc"><div class='inline'>
|
634
|
-
<p>Returns a hash representation of this row.</p>
|
635
|
-
</div></span>
|
636
|
-
|
637
|
-
</li>
|
638
|
-
|
639
|
-
|
640
|
-
<li class="public ">
|
641
|
-
<span class="summary_signature">
|
642
|
-
|
643
|
-
<a href="#to_symbols-instance_method" title="#to_symbols (instance method)">- (Array<Symbol>) <strong>to_symbols</strong> </a>
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
</span>
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
<span class="summary_desc"><div class='inline'>
|
658
|
-
<p>Converts a row to an array of symbol representations of the row content,
|
659
|
-
see also: Workbook::Cell#to_sym.</p>
|
660
|
-
</div></span>
|
661
|
-
|
662
|
-
</li>
|
663
|
-
|
664
|
-
|
665
|
-
<li class="public ">
|
666
|
-
<span class="summary_signature">
|
667
|
-
|
668
|
-
<a href="#trim-instance_method" title="#trim (instance method)">- (Workbook::Row) <strong>trim</strong>(desired_length = nil) </a>
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
</span>
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
<span class="summary_desc"><div class='inline'>
|
683
|
-
<p>remove all the trailing nil-cells (returning a trimmed clone).</p>
|
684
|
-
</div></span>
|
685
|
-
|
686
|
-
</li>
|
687
|
-
|
688
|
-
|
689
|
-
<li class="public ">
|
690
|
-
<span class="summary_signature">
|
691
|
-
|
692
|
-
<a href="#trim%21-instance_method" title="#trim! (instance method)">- (Workbook::Row) <strong>trim!</strong>(desired_length = nil) </a>
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
</span>
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
<span class="summary_desc"><div class='inline'>
|
707
|
-
<p>remove all the trailing nil-cells (returning a trimmed self).</p>
|
708
|
-
</div></span>
|
709
|
-
|
710
|
-
</li>
|
711
|
-
|
712
|
-
|
713
|
-
</ul>
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
<div id="constructor_details" class="method_details_list">
|
718
|
-
<h2>Constructor Details</h2>
|
719
|
-
|
720
|
-
<div class="method_details first">
|
721
|
-
<h3 class="signature first" id="initialize-instance_method">
|
722
|
-
|
723
|
-
- (<tt><span class='object_link'><a href="" title="Workbook::Row (class)">Row</a></span></tt>) <strong>initialize</strong>(cells = [], table = nil, options = {})
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
</h3><div class="docstring">
|
730
|
-
<div class="discussion">
|
731
|
-
|
732
|
-
<p>Initialize a new row</p>
|
733
|
-
|
734
|
-
|
735
|
-
</div>
|
736
|
-
</div>
|
737
|
-
<div class="tags">
|
738
|
-
<p class="tag_title">Parameters:</p>
|
739
|
-
<ul class="param">
|
740
|
-
|
741
|
-
<li>
|
742
|
-
|
743
|
-
<span class='name'>cells</span>
|
744
|
-
|
745
|
-
|
746
|
-
<span class='type'>(<tt><span class='object_link'><a href="" title="Workbook::Row (class)">Workbook::Row</a></span></tt>, <tt>Array<<span class='object_link'><a href="Cell.html" title="Workbook::Cell (class)">Workbook::Cell</a></span>></tt>, <tt>Array</tt>)</span>
|
747
|
-
|
748
|
-
|
749
|
-
<em class="default">(defaults to: <tt>[]</tt>)</em>
|
750
|
-
|
751
|
-
|
752
|
-
—
|
753
|
-
<div class='inline'>
|
754
|
-
<p>list of cells to initialize the row with, default is empty</p>
|
755
|
-
</div>
|
756
|
-
|
757
|
-
</li>
|
758
|
-
|
759
|
-
<li>
|
760
|
-
|
761
|
-
<span class='name'>table</span>
|
762
|
-
|
763
|
-
|
764
|
-
<span class='type'>(<tt><span class='object_link'><a href="Table.html" title="Workbook::Table (class)">Workbook::Table</a></span></tt>)</span>
|
765
|
-
|
766
|
-
|
767
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
768
|
-
|
769
|
-
|
770
|
-
—
|
771
|
-
<div class='inline'>
|
772
|
-
<p>a row normally belongs to a table, reference it here</p>
|
773
|
-
</div>
|
774
|
-
|
775
|
-
</li>
|
776
|
-
|
777
|
-
<li>
|
778
|
-
|
779
|
-
<span class='name'>options</span>
|
780
|
-
|
781
|
-
|
782
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
783
|
-
|
784
|
-
|
785
|
-
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
786
|
-
|
787
|
-
|
788
|
-
—
|
789
|
-
<div class='inline'>
|
790
|
-
<p>Supprted options: parse_cells_on_batch_creation (parse cell values during
|
791
|
-
row-initalization, default: false), cell_parse_options (default {}, see
|
792
|
-
Workbook::Modules::TypeParser)</p>
|
793
|
-
</div>
|
794
|
-
|
795
|
-
</li>
|
796
|
-
|
797
|
-
</ul>
|
798
|
-
|
799
|
-
|
800
|
-
</div><table class="source_code">
|
801
|
-
<tr>
|
802
|
-
<td>
|
803
|
-
<pre class="lines">
|
804
|
-
|
805
|
-
|
806
|
-
13
|
807
|
-
14
|
808
|
-
15
|
809
|
-
16
|
810
|
-
17
|
811
|
-
18
|
812
|
-
19
|
813
|
-
20
|
814
|
-
21
|
815
|
-
22
|
816
|
-
23
|
817
|
-
24
|
818
|
-
25
|
819
|
-
26</pre>
|
820
|
-
</td>
|
821
|
-
<td>
|
822
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/row.rb', line 13</span>
|
823
|
-
|
824
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> <span class='id identifier rubyid_cells'>cells</span><span class='op'>=</span><span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_table'>table</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span>
|
825
|
-
<span class='id identifier rubyid_options'>options</span><span class='op'>=</span><span class='id identifier rubyid_options'>options</span> <span class='op'>?</span> <span class='lbrace'>{</span><span class='symbol'>:parse_cells_on_batch_creation</span><span class='op'>=></span><span class='kw'>false</span><span class='comma'>,</span><span class='symbol'>:cell_parse_options</span><span class='op'>=></span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
826
|
-
<span class='id identifier rubyid_cells'>cells</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_cells'>cells</span><span class='op'>==</span><span class='kw'>nil</span>
|
827
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_table'>table</span><span class='op'>=</span> <span class='id identifier rubyid_table'>table</span>
|
828
|
-
<span class='id identifier rubyid_cells'>cells</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span>
|
829
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Workbook</span><span class='op'>::</span><span class='const'>Cell</span>
|
830
|
-
<span class='id identifier rubyid_c'>c</span> <span class='op'>=</span> <span class='id identifier rubyid_c'>c</span>
|
831
|
-
<span class='kw'>else</span>
|
832
|
-
<span class='id identifier rubyid_c'>c</span> <span class='op'>=</span> <span class='const'>Workbook</span><span class='op'>::</span><span class='const'>Cell</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_c'>c</span><span class='rparen'>)</span>
|
833
|
-
<span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_parse!'>parse!</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:cell_parse_options</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:parse_cells_on_batch_creation</span><span class='rbracket'>]</span>
|
834
|
-
<span class='kw'>end</span>
|
835
|
-
<span class='id identifier rubyid_push'>push</span> <span class='id identifier rubyid_c'>c</span>
|
836
|
-
<span class='kw'>end</span>
|
837
|
-
<span class='kw'>end</span></pre>
|
838
|
-
</td>
|
839
|
-
</tr>
|
840
|
-
</table>
|
841
|
-
</div>
|
842
|
-
|
843
|
-
</div>
|
844
|
-
|
845
|
-
<div id="instance_attr_details" class="attr_details">
|
846
|
-
<h2>Instance Attribute Details</h2>
|
847
|
-
|
848
|
-
|
849
|
-
<span id="format=-instance_method"></span>
|
850
|
-
<div class="method_details first">
|
851
|
-
<h3 class="signature first" id="format-instance_method">
|
852
|
-
|
853
|
-
- (<tt>Object</tt>) <strong>format</strong>
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
</h3><div class="docstring">
|
860
|
-
<div class="discussion">
|
861
|
-
|
862
|
-
<p>Returns the value of attribute format</p>
|
863
|
-
|
864
|
-
|
865
|
-
</div>
|
866
|
-
</div>
|
867
|
-
<div class="tags">
|
868
|
-
|
869
|
-
|
870
|
-
</div><table class="source_code">
|
871
|
-
<tr>
|
872
|
-
<td>
|
873
|
-
<pre class="lines">
|
874
|
-
|
875
|
-
|
876
|
-
6
|
877
|
-
7
|
878
|
-
8</pre>
|
879
|
-
</td>
|
880
|
-
<td>
|
881
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/row.rb', line 6</span>
|
882
|
-
|
883
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_format'>format</span>
|
884
|
-
<span class='ivar'>@format</span>
|
885
|
-
<span class='kw'>end</span></pre>
|
886
|
-
</td>
|
887
|
-
</tr>
|
888
|
-
</table>
|
889
|
-
</div>
|
890
|
-
|
891
|
-
|
892
|
-
<span id="placeholder=-instance_method"></span>
|
893
|
-
<div class="method_details ">
|
894
|
-
<h3 class="signature " id="placeholder-instance_method">
|
895
|
-
|
896
|
-
- (<tt>Object</tt>) <strong>placeholder</strong>
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
</h3><div class="docstring">
|
903
|
-
<div class="discussion">
|
904
|
-
|
905
|
-
<p>The placeholder attribute is used in compares (corresponds to newly created
|
906
|
-
or removed lines (depending which side you're on)</p>
|
907
|
-
|
908
|
-
|
909
|
-
</div>
|
910
|
-
</div>
|
911
|
-
<div class="tags">
|
912
|
-
|
913
|
-
|
914
|
-
</div><table class="source_code">
|
915
|
-
<tr>
|
916
|
-
<td>
|
917
|
-
<pre class="lines">
|
918
|
-
|
919
|
-
|
920
|
-
5
|
921
|
-
6
|
922
|
-
7</pre>
|
923
|
-
</td>
|
924
|
-
<td>
|
925
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/row.rb', line 5</span>
|
926
|
-
|
927
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_placeholder'>placeholder</span>
|
928
|
-
<span class='ivar'>@placeholder</span>
|
929
|
-
<span class='kw'>end</span></pre>
|
930
|
-
</td>
|
931
|
-
</tr>
|
932
|
-
</table>
|
933
|
-
</div>
|
934
|
-
|
935
|
-
</div>
|
936
|
-
|
937
|
-
|
938
|
-
<div id="instance_method_details" class="method_details_list">
|
939
|
-
<h2>Instance Method Details</h2>
|
940
|
-
|
941
|
-
|
942
|
-
<div class="method_details first">
|
943
|
-
<h3 class="signature first" id="<=>-instance_method">
|
944
|
-
|
945
|
-
- (<tt><span class='object_link'><a href="" title="Workbook::Row (class)">Workbook::Row</a></span></tt>) <strong><=></strong>(other)
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
</h3><div class="docstring">
|
952
|
-
<div class="discussion">
|
953
|
-
|
954
|
-
<p>Compares one row wiht another</p>
|
955
|
-
|
956
|
-
|
957
|
-
</div>
|
958
|
-
</div>
|
959
|
-
<div class="tags">
|
960
|
-
<p class="tag_title">Parameters:</p>
|
961
|
-
<ul class="param">
|
962
|
-
|
963
|
-
<li>
|
964
|
-
|
965
|
-
<span class='name'>other</span>
|
966
|
-
|
967
|
-
|
968
|
-
<span class='type'>(<tt><span class='object_link'><a href="" title="Workbook::Row (class)">Workbook::Row</a></span></tt>)</span>
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
—
|
973
|
-
<div class='inline'>
|
974
|
-
<p>row to compare against</p>
|
975
|
-
</div>
|
976
|
-
|
977
|
-
</li>
|
978
|
-
|
979
|
-
</ul>
|
980
|
-
|
981
|
-
<p class="tag_title">Returns:</p>
|
982
|
-
<ul class="return">
|
983
|
-
|
984
|
-
<li>
|
985
|
-
|
986
|
-
|
987
|
-
<span class='type'>(<tt><span class='object_link'><a href="" title="Workbook::Row (class)">Workbook::Row</a></span></tt>)</span>
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
—
|
992
|
-
<div class='inline'>
|
993
|
-
<p>a row with the diff result.</p>
|
994
|
-
</div>
|
995
|
-
|
996
|
-
</li>
|
997
|
-
|
998
|
-
</ul>
|
999
|
-
|
1000
|
-
</div><table class="source_code">
|
1001
|
-
<tr>
|
1002
|
-
<td>
|
1003
|
-
<pre class="lines">
|
1004
|
-
|
1005
|
-
|
1006
|
-
176
|
1007
|
-
177
|
1008
|
-
178
|
1009
|
-
179
|
1010
|
-
180
|
1011
|
-
181</pre>
|
1012
|
-
</td>
|
1013
|
-
<td>
|
1014
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/row.rb', line 176</span>
|
1015
|
-
|
1016
|
-
<span class='kw'>def</span> <span class='op'><=></span> <span class='id identifier rubyid_other'>other</span>
|
1017
|
-
<span class='id identifier rubyid_a'>a</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_header?'>header?</span> <span class='op'>?</span> <span class='int'>0</span> <span class='op'>:</span> <span class='int'>1</span>
|
1018
|
-
<span class='id identifier rubyid_b'>b</span> <span class='op'>=</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_header?'>header?</span> <span class='op'>?</span> <span class='int'>0</span> <span class='op'>:</span> <span class='int'>1</span>
|
1019
|
-
<span class='kw'>return</span> <span class='lparen'>(</span><span class='id identifier rubyid_a'>a</span> <span class='op'><=></span> <span class='id identifier rubyid_b'>b</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_a'>a</span><span class='op'>==</span><span class='int'>0</span> <span class='kw'>or</span> <span class='id identifier rubyid_b'>b</span><span class='op'>==</span><span class='int'>0</span><span class='rparen'>)</span>
|
1020
|
-
<span class='id identifier rubyid_compare_without_header'>compare_without_header</span> <span class='id identifier rubyid_other'>other</span>
|
1021
|
-
<span class='kw'>end</span></pre>
|
1022
|
-
</td>
|
1023
|
-
</tr>
|
1024
|
-
</table>
|
1025
|
-
</div>
|
1026
|
-
|
1027
|
-
<div class="method_details ">
|
1028
|
-
<h3 class="signature " id="[]-instance_method">
|
1029
|
-
|
1030
|
-
- (<tt><span class='object_link'><a href="Cell.html" title="Workbook::Cell (class)">Workbook::Cell</a></span></tt><sup>?</sup>) <strong>[]</strong>(index_or_hash)
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
</h3><div class="docstring">
|
1037
|
-
<div class="discussion">
|
1038
|
-
|
1039
|
-
<p>Overrides normal Array's []-function with support for symbols that identify
|
1040
|
-
a column based on the header-values</p>
|
1041
|
-
|
1042
|
-
|
1043
|
-
</div>
|
1044
|
-
</div>
|
1045
|
-
<div class="tags">
|
1046
|
-
|
1047
|
-
<div class="examples">
|
1048
|
-
<p class="tag_title">Examples:</p>
|
1049
|
-
|
1050
|
-
|
1051
|
-
<p class="example_title"><div class='inline'>
|
1052
|
-
<p>Lookup using fixnum or header value encoded as symbol</p>
|
1053
|
-
</div></p>
|
1054
|
-
|
1055
|
-
<pre class="example code"><code><span class='id identifier rubyid_row'>row</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='comment'>#=> <Cell value="a">
|
1056
|
-
</span><span class='id identifier rubyid_row'>row</span><span class='lbracket'>[</span><span class='symbol'>:a</span><span class='rbracket'>]</span> <span class='comment'>#=> <Cell value="a"></span></code></pre>
|
1057
|
-
|
1058
|
-
</div>
|
1059
|
-
<p class="tag_title">Parameters:</p>
|
1060
|
-
<ul class="param">
|
1061
|
-
|
1062
|
-
<li>
|
1063
|
-
|
1064
|
-
<span class='name'>index_or_hash</span>
|
1065
|
-
|
1066
|
-
|
1067
|
-
<span class='type'>(<tt>Fixnum</tt>, <tt>Symbol</tt>)</span>
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
</li>
|
1072
|
-
|
1073
|
-
</ul>
|
1074
|
-
|
1075
|
-
<p class="tag_title">Returns:</p>
|
1076
|
-
<ul class="return">
|
1077
|
-
|
1078
|
-
<li>
|
1079
|
-
|
1080
|
-
|
1081
|
-
<span class='type'>(<tt><span class='object_link'><a href="Cell.html" title="Workbook::Cell (class)">Workbook::Cell</a></span></tt>, <tt>nil</tt>)</span>
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
</li>
|
1086
|
-
|
1087
|
-
</ul>
|
1088
|
-
|
1089
|
-
</div><table class="source_code">
|
1090
|
-
<tr>
|
1091
|
-
<td>
|
1092
|
-
<pre class="lines">
|
1093
|
-
|
1094
|
-
|
1095
|
-
68
|
1096
|
-
69
|
1097
|
-
70
|
1098
|
-
71
|
1099
|
-
72
|
1100
|
-
73
|
1101
|
-
74
|
1102
|
-
75
|
1103
|
-
76
|
1104
|
-
77
|
1105
|
-
78
|
1106
|
-
79
|
1107
|
-
80
|
1108
|
-
81</pre>
|
1109
|
-
</td>
|
1110
|
-
<td>
|
1111
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/row.rb', line 68</span>
|
1112
|
-
|
1113
|
-
<span class='kw'>def</span> <span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_index_or_hash'>index_or_hash</span><span class='rparen'>)</span>
|
1114
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_index_or_hash'>index_or_hash</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Symbol</span>
|
1115
|
-
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
1116
|
-
<span class='kw'>begin</span>
|
1117
|
-
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='id identifier rubyid_to_hash'>to_hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_index_or_hash'>index_or_hash</span><span class='rbracket'>]</span>
|
1118
|
-
<span class='kw'>rescue</span> <span class='const'>NoMethodError</span>
|
1119
|
-
<span class='kw'>end</span>
|
1120
|
-
<span class='kw'>return</span> <span class='id identifier rubyid_rv'>rv</span>
|
1121
|
-
<span class='kw'>else</span>
|
1122
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_index_or_hash'>index_or_hash</span>
|
1123
|
-
<span class='kw'>return</span> <span class='id identifier rubyid_to_a'>to_a</span><span class='lbracket'>[</span><span class='id identifier rubyid_index_or_hash'>index_or_hash</span><span class='rbracket'>]</span>
|
1124
|
-
<span class='kw'>end</span>
|
1125
|
-
<span class='kw'>end</span>
|
1126
|
-
<span class='kw'>end</span></pre>
|
1127
|
-
</td>
|
1128
|
-
</tr>
|
1129
|
-
</table>
|
1130
|
-
</div>
|
1131
|
-
|
1132
|
-
<div class="method_details ">
|
1133
|
-
<h3 class="signature " id="[]=-instance_method">
|
1134
|
-
|
1135
|
-
- (<tt><span class='object_link'><a href="Cell.html" title="Workbook::Cell (class)">Workbook::Cell</a></span></tt><sup>?</sup>) <strong>[]=</strong>(index_or_hash, value)
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
</h3><div class="docstring">
|
1142
|
-
<div class="discussion">
|
1143
|
-
|
1144
|
-
<p>Overrides normal Array's []=-function with support for symbols that
|
1145
|
-
identify a column based on the header-values</p>
|
1146
|
-
|
1147
|
-
|
1148
|
-
</div>
|
1149
|
-
</div>
|
1150
|
-
<div class="tags">
|
1151
|
-
|
1152
|
-
<div class="examples">
|
1153
|
-
<p class="tag_title">Examples:</p>
|
1154
|
-
|
1155
|
-
|
1156
|
-
<p class="example_title"><div class='inline'>
|
1157
|
-
<p>Lookup using fixnum or header value encoded as symbol</p>
|
1158
|
-
</div></p>
|
1159
|
-
|
1160
|
-
<pre class="example code"><code><span class='id identifier rubyid_row'>row</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='comment'>#=> <Cell value="a">
|
1161
|
-
</span><span class='id identifier rubyid_row'>row</span><span class='lbracket'>[</span><span class='symbol'>:a</span><span class='rbracket'>]</span> <span class='comment'>#=> <Cell value="a"></span></code></pre>
|
1162
|
-
|
1163
|
-
</div>
|
1164
|
-
<p class="tag_title">Parameters:</p>
|
1165
|
-
<ul class="param">
|
1166
|
-
|
1167
|
-
<li>
|
1168
|
-
|
1169
|
-
<span class='name'>index_or_hash</span>
|
1170
|
-
|
1171
|
-
|
1172
|
-
<span class='type'>(<tt>Fixnum</tt>, <tt>Symbol</tt>)</span>
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
</li>
|
1177
|
-
|
1178
|
-
<li>
|
1179
|
-
|
1180
|
-
<span class='name'>value</span>
|
1181
|
-
|
1182
|
-
|
1183
|
-
<span class='type'>(<tt>String</tt>, <tt>Fixnum</tt>, <tt>NilClass</tt>, <tt>Date</tt>, <tt>DateTime</tt>, <tt>Time</tt>, <tt>Float</tt>)</span>
|
1184
|
-
|
1185
|
-
|
1186
|
-
|
1187
|
-
</li>
|
1188
|
-
|
1189
|
-
</ul>
|
1190
|
-
|
1191
|
-
<p class="tag_title">Returns:</p>
|
1192
|
-
<ul class="return">
|
1193
|
-
|
1194
|
-
<li>
|
1195
|
-
|
1196
|
-
|
1197
|
-
<span class='type'>(<tt><span class='object_link'><a href="Cell.html" title="Workbook::Cell (class)">Workbook::Cell</a></span></tt>, <tt>nil</tt>)</span>
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
</li>
|
1202
|
-
|
1203
|
-
</ul>
|
1204
|
-
|
1205
|
-
</div><table class="source_code">
|
1206
|
-
<tr>
|
1207
|
-
<td>
|
1208
|
-
<pre class="lines">
|
1209
|
-
|
1210
|
-
|
1211
|
-
92
|
1212
|
-
93
|
1213
|
-
94
|
1214
|
-
95
|
1215
|
-
96
|
1216
|
-
97
|
1217
|
-
98
|
1218
|
-
99
|
1219
|
-
100
|
1220
|
-
101
|
1221
|
-
102
|
1222
|
-
103
|
1223
|
-
104
|
1224
|
-
105
|
1225
|
-
106
|
1226
|
-
107
|
1227
|
-
108
|
1228
|
-
109</pre>
|
1229
|
-
</td>
|
1230
|
-
<td>
|
1231
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/row.rb', line 92</span>
|
1232
|
-
|
1233
|
-
<span class='kw'>def</span> <span class='op'>[]=</span> <span class='lparen'>(</span><span class='id identifier rubyid_index_or_hash'>index_or_hash</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
1234
|
-
<span class='id identifier rubyid_index'>index</span> <span class='op'>=</span> <span class='id identifier rubyid_index_or_hash'>index_or_hash</span>
|
1235
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_index_or_hash'>index_or_hash</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Symbol</span>
|
1236
|
-
<span class='id identifier rubyid_index'>index</span> <span class='op'>=</span> <span class='id identifier rubyid_table_header_keys'>table_header_keys</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span><span class='lparen'>(</span><span class='id identifier rubyid_index_or_hash'>index_or_hash</span><span class='rparen'>)</span>
|
1237
|
-
<span class='kw'>end</span>
|
1238
|
-
|
1239
|
-
<span class='id identifier rubyid_value_celled'>value_celled</span> <span class='op'>=</span> <span class='const'>Workbook</span><span class='op'>::</span><span class='const'>Cell</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
1240
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Workbook</span><span class='op'>::</span><span class='const'>Cell</span>
|
1241
|
-
<span class='id identifier rubyid_value_celled'>value_celled</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
|
1242
|
-
<span class='kw'>else</span>
|
1243
|
-
<span class='id identifier rubyid_current_cell'>current_cell</span> <span class='op'>=</span> <span class='kw'>self</span><span class='lbracket'>[</span><span class='id identifier rubyid_index'>index</span><span class='rbracket'>]</span>
|
1244
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_current_cell'>current_cell</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Workbook</span><span class='op'>::</span><span class='const'>Cell</span>
|
1245
|
-
<span class='id identifier rubyid_value_celled'>value_celled</span> <span class='op'>=</span> <span class='id identifier rubyid_current_cell'>current_cell</span>
|
1246
|
-
<span class='kw'>end</span>
|
1247
|
-
<span class='id identifier rubyid_value_celled'>value_celled</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span><span class='op'>=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
1248
|
-
<span class='kw'>end</span>
|
1249
|
-
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_index'>index</span><span class='comma'>,</span><span class='id identifier rubyid_value_celled'>value_celled</span><span class='rparen'>)</span>
|
1250
|
-
<span class='kw'>end</span></pre>
|
1251
|
-
</td>
|
1252
|
-
</tr>
|
1253
|
-
</table>
|
1254
|
-
</div>
|
1255
|
-
|
1256
|
-
<div class="method_details ">
|
1257
|
-
<h3 class="signature " id="clone-instance_method">
|
1258
|
-
|
1259
|
-
- (<tt><span class='object_link'><a href="" title="Workbook::Row (class)">Workbook::Row</a></span></tt>) <strong>clone</strong>
|
1260
|
-
|
1261
|
-
|
1262
|
-
|
1263
|
-
|
1264
|
-
|
1265
|
-
</h3><div class="docstring">
|
1266
|
-
<div class="discussion">
|
1267
|
-
|
1268
|
-
<p>clone the row with together with the cells</p>
|
1269
|
-
|
1270
|
-
|
1271
|
-
</div>
|
1272
|
-
</div>
|
1273
|
-
<div class="tags">
|
1274
|
-
|
1275
|
-
<p class="tag_title">Returns:</p>
|
1276
|
-
<ul class="return">
|
1277
|
-
|
1278
|
-
<li>
|
1279
|
-
|
1280
|
-
|
1281
|
-
<span class='type'>(<tt><span class='object_link'><a href="" title="Workbook::Row (class)">Workbook::Row</a></span></tt>)</span>
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1285
|
-
—
|
1286
|
-
<div class='inline'>
|
1287
|
-
<p>a cloned copy of self with cells</p>
|
1288
|
-
</div>
|
1289
|
-
|
1290
|
-
</li>
|
1291
|
-
|
1292
|
-
</ul>
|
1293
|
-
|
1294
|
-
</div><table class="source_code">
|
1295
|
-
<tr>
|
1296
|
-
<td>
|
1297
|
-
<pre class="lines">
|
1298
|
-
|
1299
|
-
|
1300
|
-
199
|
1301
|
-
200
|
1302
|
-
201</pre>
|
1303
|
-
</td>
|
1304
|
-
<td>
|
1305
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/row.rb', line 199</span>
|
1306
|
-
|
1307
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_clone'>clone</span>
|
1308
|
-
<span class='const'>Workbook</span><span class='op'>::</span><span class='const'>Row</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_to_a'>to_a</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_clone'>clone</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
1309
|
-
<span class='kw'>end</span></pre>
|
1310
|
-
</td>
|
1311
|
-
</tr>
|
1312
|
-
</table>
|
1313
|
-
</div>
|
1314
|
-
|
1315
|
-
<div class="method_details ">
|
1316
|
-
<h3 class="signature " id="compact-instance_method">
|
1317
|
-
|
1318
|
-
- (<tt>Object</tt>) <strong>compact</strong>
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
</h3><div class="docstring">
|
1325
|
-
<div class="discussion">
|
1326
|
-
|
1327
|
-
<p>Compact detaches the row from the table</p>
|
1328
|
-
|
1329
|
-
|
1330
|
-
</div>
|
1331
|
-
</div>
|
1332
|
-
<div class="tags">
|
1333
|
-
|
1334
|
-
|
1335
|
-
</div><table class="source_code">
|
1336
|
-
<tr>
|
1337
|
-
<td>
|
1338
|
-
<pre class="lines">
|
1339
|
-
|
1340
|
-
|
1341
|
-
191
|
1342
|
-
192
|
1343
|
-
193
|
1344
|
-
194</pre>
|
1345
|
-
</td>
|
1346
|
-
<td>
|
1347
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/row.rb', line 191</span>
|
1348
|
-
|
1349
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_compact'>compact</span>
|
1350
|
-
<span class='id identifier rubyid_r'>r</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_clone'>clone</span>
|
1351
|
-
<span class='id identifier rubyid_r'>r</span> <span class='op'>=</span> <span class='id identifier rubyid_r'>r</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span> <span class='id identifier rubyid_c'>c</span> <span class='kw'>unless</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span>
|
1352
|
-
<span class='kw'>end</span></pre>
|
1353
|
-
</td>
|
1354
|
-
</tr>
|
1355
|
-
</table>
|
1356
|
-
</div>
|
1357
|
-
|
1358
|
-
<div class="method_details ">
|
1359
|
-
<h3 class="signature " id="compare_without_header-instance_method">
|
1360
|
-
|
1361
|
-
- (<tt>Object</tt>) <strong>compare_without_header</strong>
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1365
|
-
|
1366
|
-
|
1367
|
-
</h3><table class="source_code">
|
1368
|
-
<tr>
|
1369
|
-
<td>
|
1370
|
-
<pre class="lines">
|
1371
|
-
|
1372
|
-
|
1373
|
-
4</pre>
|
1374
|
-
</td>
|
1375
|
-
<td>
|
1376
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/row.rb', line 4</span>
|
1377
|
-
|
1378
|
-
<span class='id identifier rubyid_alias_method'>alias_method</span> <span class='symbol'>:compare_without_header</span><span class='comma'>,</span> <span class='symbol'>:<=></span></pre>
|
1379
|
-
</td>
|
1380
|
-
</tr>
|
1381
|
-
</table>
|
1382
|
-
</div>
|
1383
|
-
|
1384
|
-
<div class="method_details ">
|
1385
|
-
<h3 class="signature " id="find_cells_by_background_color-instance_method">
|
1386
|
-
|
1387
|
-
- (<tt>Array<Symbol></tt>, <tt><span class='object_link'><a href="" title="Workbook::Row (class)">Workbook::Row</a></span><<span class='object_link'><a href="Cell.html" title="Workbook::Cell (class)">Workbook::Cell</a></span>></tt>) <strong>find_cells_by_background_color</strong>(color = :any, options = {})
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
</h3><div class="docstring">
|
1394
|
-
<div class="discussion">
|
1395
|
-
|
1396
|
-
<p>Returns an array of cells allows you to find cells by a given color,
|
1397
|
-
normally a string containing a hex</p>
|
1398
|
-
|
1399
|
-
|
1400
|
-
</div>
|
1401
|
-
</div>
|
1402
|
-
<div class="tags">
|
1403
|
-
<p class="tag_title">Parameters:</p>
|
1404
|
-
<ul class="param">
|
1405
|
-
|
1406
|
-
<li>
|
1407
|
-
|
1408
|
-
<span class='name'>color</span>
|
1409
|
-
|
1410
|
-
|
1411
|
-
<span class='type'>(<tt>String</tt>)</span>
|
1412
|
-
|
1413
|
-
|
1414
|
-
<em class="default">(defaults to: <tt>:any</tt>)</em>
|
1415
|
-
|
1416
|
-
|
1417
|
-
—
|
1418
|
-
<div class='inline'>
|
1419
|
-
<p>a CSS-style hex-string</p>
|
1420
|
-
</div>
|
1421
|
-
|
1422
|
-
</li>
|
1423
|
-
|
1424
|
-
<li>
|
1425
|
-
|
1426
|
-
<span class='name'>options</span>
|
1427
|
-
|
1428
|
-
|
1429
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
1430
|
-
|
1431
|
-
|
1432
|
-
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
1433
|
-
|
1434
|
-
|
1435
|
-
—
|
1436
|
-
<div class='inline'>
|
1437
|
-
<p>Option :hash_keys (default true) returns row as an array of symbols</p>
|
1438
|
-
</div>
|
1439
|
-
|
1440
|
-
</li>
|
1441
|
-
|
1442
|
-
</ul>
|
1443
|
-
|
1444
|
-
<p class="tag_title">Returns:</p>
|
1445
|
-
<ul class="return">
|
1446
|
-
|
1447
|
-
<li>
|
1448
|
-
|
1449
|
-
|
1450
|
-
<span class='type'>(<tt>Array<Symbol></tt>, <tt><span class='object_link'><a href="" title="Workbook::Row (class)">Workbook::Row</a></span><<span class='object_link'><a href="Cell.html" title="Workbook::Cell (class)">Workbook::Cell</a></span>></tt>)</span>
|
1451
|
-
|
1452
|
-
|
1453
|
-
|
1454
|
-
</li>
|
1455
|
-
|
1456
|
-
</ul>
|
1457
|
-
|
1458
|
-
</div><table class="source_code">
|
1459
|
-
<tr>
|
1460
|
-
<td>
|
1461
|
-
<pre class="lines">
|
1462
|
-
|
1463
|
-
|
1464
|
-
116
|
1465
|
-
117
|
1466
|
-
118
|
1467
|
-
119
|
1468
|
-
120
|
1469
|
-
121</pre>
|
1470
|
-
</td>
|
1471
|
-
<td>
|
1472
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/row.rb', line 116</span>
|
1473
|
-
|
1474
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_find_cells_by_background_color'>find_cells_by_background_color</span> <span class='id identifier rubyid_color'>color</span><span class='op'>=</span><span class='symbol'>:any</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span>
|
1475
|
-
<span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='symbol'>:hash_keys</span><span class='op'>=></span><span class='kw'>true</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
1476
|
-
<span class='id identifier rubyid_cells'>cells</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span> <span class='id identifier rubyid_c'>c</span> <span class='kw'>if</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_format'>format</span><span class='period'>.</span><span class='id identifier rubyid_has_background_color?'>has_background_color?</span><span class='lparen'>(</span><span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span>
|
1477
|
-
<span class='id identifier rubyid_r'>r</span> <span class='op'>=</span> <span class='const'>Row</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_cells'>cells</span>
|
1478
|
-
<span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:hash_keys</span><span class='rbracket'>]</span> <span class='op'>?</span> <span class='id identifier rubyid_r'>r</span><span class='period'>.</span><span class='id identifier rubyid_to_symbols'>to_symbols</span> <span class='op'>:</span> <span class='id identifier rubyid_r'>r</span>
|
1479
|
-
<span class='kw'>end</span></pre>
|
1480
|
-
</td>
|
1481
|
-
</tr>
|
1482
|
-
</table>
|
1483
|
-
</div>
|
1484
|
-
|
1485
|
-
<div class="method_details ">
|
1486
|
-
<h3 class="signature " id="first?-instance_method">
|
1487
|
-
|
1488
|
-
- (<tt>Boolean</tt>, <tt>NilClass</tt>) <strong>first?</strong>
|
1489
|
-
|
1490
|
-
|
1491
|
-
|
1492
|
-
|
1493
|
-
|
1494
|
-
</h3><div class="docstring">
|
1495
|
-
<div class="discussion">
|
1496
|
-
|
1497
|
-
<p>Is this the first row in the table</p>
|
1498
|
-
|
1499
|
-
|
1500
|
-
</div>
|
1501
|
-
</div>
|
1502
|
-
<div class="tags">
|
1503
|
-
|
1504
|
-
<p class="tag_title">Returns:</p>
|
1505
|
-
<ul class="return">
|
1506
|
-
|
1507
|
-
<li>
|
1508
|
-
|
1509
|
-
|
1510
|
-
<span class='type'>(<tt>Boolean</tt>, <tt>NilClass</tt>)</span>
|
1511
|
-
|
1512
|
-
|
1513
|
-
|
1514
|
-
—
|
1515
|
-
<div class='inline'>
|
1516
|
-
<p>returns nil if it doesn’t belong to a table, false when it isn’t the first
|
1517
|
-
row of a table and true when it is.</p>
|
1518
|
-
</div>
|
1519
|
-
|
1520
|
-
</li>
|
1521
|
-
|
1522
|
-
</ul>
|
1523
|
-
|
1524
|
-
</div><table class="source_code">
|
1525
|
-
<tr>
|
1526
|
-
<td>
|
1527
|
-
<pre class="lines">
|
1528
|
-
|
1529
|
-
|
1530
|
-
133
|
1531
|
-
134
|
1532
|
-
135</pre>
|
1533
|
-
</td>
|
1534
|
-
<td>
|
1535
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/row.rb', line 133</span>
|
1536
|
-
|
1537
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_first?'>first?</span>
|
1538
|
-
<span class='id identifier rubyid_table'>table</span> <span class='op'>!=</span> <span class='kw'>nil</span> <span class='kw'>and</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_object_id'>object_id</span> <span class='op'>==</span> <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='period'>.</span><span class='id identifier rubyid_object_id'>object_id</span>
|
1539
|
-
<span class='kw'>end</span></pre>
|
1540
|
-
</td>
|
1541
|
-
</tr>
|
1542
|
-
</table>
|
1543
|
-
</div>
|
1544
|
-
|
1545
|
-
<div class="method_details ">
|
1546
|
-
<h3 class="signature " id="header?-instance_method">
|
1547
|
-
|
1548
|
-
- (<tt>Boolean</tt>) <strong>header?</strong>
|
1549
|
-
|
1550
|
-
|
1551
|
-
|
1552
|
-
|
1553
|
-
|
1554
|
-
</h3><div class="docstring">
|
1555
|
-
<div class="discussion">
|
1556
|
-
|
1557
|
-
<p>Returns true when the row belongs to a table and it is the header row
|
1558
|
-
(typically the first row)</p>
|
1559
|
-
|
1560
|
-
|
1561
|
-
</div>
|
1562
|
-
</div>
|
1563
|
-
<div class="tags">
|
1564
|
-
|
1565
|
-
<p class="tag_title">Returns:</p>
|
1566
|
-
<ul class="return">
|
1567
|
-
|
1568
|
-
<li>
|
1569
|
-
|
1570
|
-
|
1571
|
-
<span class='type'>(<tt>Boolean</tt>)</span>
|
1572
|
-
|
1573
|
-
|
1574
|
-
|
1575
|
-
</li>
|
1576
|
-
|
1577
|
-
</ul>
|
1578
|
-
|
1579
|
-
</div><table class="source_code">
|
1580
|
-
<tr>
|
1581
|
-
<td>
|
1582
|
-
<pre class="lines">
|
1583
|
-
|
1584
|
-
|
1585
|
-
126
|
1586
|
-
127
|
1587
|
-
128</pre>
|
1588
|
-
</td>
|
1589
|
-
<td>
|
1590
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/row.rb', line 126</span>
|
1591
|
-
|
1592
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_header?'>header?</span>
|
1593
|
-
<span class='id identifier rubyid_table'>table</span> <span class='op'>!=</span> <span class='kw'>nil</span> <span class='kw'>and</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_object_id'>object_id</span> <span class='op'>==</span> <span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_header'>header</span><span class='period'>.</span><span class='id identifier rubyid_object_id'>object_id</span>
|
1594
|
-
<span class='kw'>end</span></pre>
|
1595
|
-
</td>
|
1596
|
-
</tr>
|
1597
|
-
</table>
|
1598
|
-
</div>
|
1599
|
-
|
1600
|
-
<div class="method_details ">
|
1601
|
-
<h3 class="signature " id="key-instance_method">
|
1602
|
-
|
1603
|
-
- (<tt><span class='object_link'><a href="Cell.html" title="Workbook::Cell (class)">Workbook::Cell</a></span></tt>) <strong>key</strong>
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1607
|
-
|
1608
|
-
|
1609
|
-
</h3><div class="docstring">
|
1610
|
-
<div class="discussion">
|
1611
|
-
|
1612
|
-
<p>The first cell of the row is considered to be the key</p>
|
1613
|
-
|
1614
|
-
|
1615
|
-
</div>
|
1616
|
-
</div>
|
1617
|
-
<div class="tags">
|
1618
|
-
|
1619
|
-
<p class="tag_title">Returns:</p>
|
1620
|
-
<ul class="return">
|
1621
|
-
|
1622
|
-
<li>
|
1623
|
-
|
1624
|
-
|
1625
|
-
<span class='type'>(<tt><span class='object_link'><a href="Cell.html" title="Workbook::Cell (class)">Workbook::Cell</a></span></tt>)</span>
|
1626
|
-
|
1627
|
-
|
1628
|
-
|
1629
|
-
—
|
1630
|
-
<div class='inline'>
|
1631
|
-
<p>the key cell</p>
|
1632
|
-
</div>
|
1633
|
-
|
1634
|
-
</li>
|
1635
|
-
|
1636
|
-
</ul>
|
1637
|
-
|
1638
|
-
</div><table class="source_code">
|
1639
|
-
<tr>
|
1640
|
-
<td>
|
1641
|
-
<pre class="lines">
|
1642
|
-
|
1643
|
-
|
1644
|
-
186
|
1645
|
-
187
|
1646
|
-
188</pre>
|
1647
|
-
</td>
|
1648
|
-
<td>
|
1649
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/row.rb', line 186</span>
|
1650
|
-
|
1651
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_key'>key</span>
|
1652
|
-
<span class='id identifier rubyid_first'>first</span>
|
1653
|
-
<span class='kw'>end</span></pre>
|
1654
|
-
</td>
|
1655
|
-
</tr>
|
1656
|
-
</table>
|
1657
|
-
</div>
|
1658
|
-
|
1659
|
-
<div class="method_details ">
|
1660
|
-
<h3 class="signature " id="no_values?-instance_method">
|
1661
|
-
|
1662
|
-
- (<tt>Boolean</tt>) <strong>no_values?</strong>
|
1663
|
-
|
1664
|
-
|
1665
|
-
|
1666
|
-
|
1667
|
-
|
1668
|
-
</h3><div class="docstring">
|
1669
|
-
<div class="discussion">
|
1670
|
-
|
1671
|
-
<p>Returns true when all the cells in the row have values whose to_s value
|
1672
|
-
equals an empty string</p>
|
1673
|
-
|
1674
|
-
|
1675
|
-
</div>
|
1676
|
-
</div>
|
1677
|
-
<div class="tags">
|
1678
|
-
|
1679
|
-
<p class="tag_title">Returns:</p>
|
1680
|
-
<ul class="return">
|
1681
|
-
|
1682
|
-
<li>
|
1683
|
-
|
1684
|
-
|
1685
|
-
<span class='type'>(<tt>Boolean</tt>)</span>
|
1686
|
-
|
1687
|
-
|
1688
|
-
|
1689
|
-
</li>
|
1690
|
-
|
1691
|
-
</ul>
|
1692
|
-
|
1693
|
-
</div><table class="source_code">
|
1694
|
-
<tr>
|
1695
|
-
<td>
|
1696
|
-
<pre class="lines">
|
1697
|
-
|
1698
|
-
|
1699
|
-
140
|
1700
|
-
141
|
1701
|
-
142</pre>
|
1702
|
-
</td>
|
1703
|
-
<td>
|
1704
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/row.rb', line 140</span>
|
1705
|
-
|
1706
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_no_values?'>no_values?</span>
|
1707
|
-
<span class='id identifier rubyid_all?'>all?</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='rbrace'>}</span>
|
1708
|
-
<span class='kw'>end</span></pre>
|
1709
|
-
</td>
|
1710
|
-
</tr>
|
1711
|
-
</table>
|
1712
|
-
</div>
|
1713
|
-
|
1714
|
-
<div class="method_details ">
|
1715
|
-
<h3 class="signature " id="placeholder?-instance_method">
|
1716
|
-
|
1717
|
-
- (<tt>Boolean</tt>) <strong>placeholder?</strong>
|
1718
|
-
|
1719
|
-
|
1720
|
-
|
1721
|
-
|
1722
|
-
|
1723
|
-
</h3><div class="docstring">
|
1724
|
-
<div class="discussion">
|
1725
|
-
|
1726
|
-
<p>An internal function used in diffs</p>
|
1727
|
-
|
1728
|
-
|
1729
|
-
</div>
|
1730
|
-
</div>
|
1731
|
-
<div class="tags">
|
1732
|
-
|
1733
|
-
<p class="tag_title">Returns:</p>
|
1734
|
-
<ul class="return">
|
1735
|
-
|
1736
|
-
<li>
|
1737
|
-
|
1738
|
-
|
1739
|
-
<span class='type'>(<tt>Boolean</tt>)</span>
|
1740
|
-
|
1741
|
-
|
1742
|
-
|
1743
|
-
—
|
1744
|
-
<div class='inline'>
|
1745
|
-
<p>returns true when this row is not an actual row, but a placeholder row to
|
1746
|
-
‘compare’ against</p>
|
1747
|
-
</div>
|
1748
|
-
|
1749
|
-
</li>
|
1750
|
-
|
1751
|
-
</ul>
|
1752
|
-
|
1753
|
-
</div><table class="source_code">
|
1754
|
-
<tr>
|
1755
|
-
<td>
|
1756
|
-
<pre class="lines">
|
1757
|
-
|
1758
|
-
|
1759
|
-
31
|
1760
|
-
32
|
1761
|
-
33</pre>
|
1762
|
-
</td>
|
1763
|
-
<td>
|
1764
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/row.rb', line 31</span>
|
1765
|
-
|
1766
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_placeholder?'>placeholder?</span>
|
1767
|
-
<span class='id identifier rubyid_placeholder'>placeholder</span> <span class='op'>?</span> <span class='kw'>true</span> <span class='op'>:</span> <span class='kw'>false</span>
|
1768
|
-
<span class='kw'>end</span></pre>
|
1769
|
-
</td>
|
1770
|
-
</tr>
|
1771
|
-
</table>
|
1772
|
-
</div>
|
1773
|
-
|
1774
|
-
<div class="method_details ">
|
1775
|
-
<h3 class="signature " id="set_table-instance_method">
|
1776
|
-
|
1777
|
-
- (<tt>Object</tt>) <strong>set_table</strong>(t)
|
1778
|
-
|
1779
|
-
|
1780
|
-
|
1781
|
-
|
1782
|
-
|
1783
|
-
</h3><div class="docstring">
|
1784
|
-
<div class="discussion">
|
1785
|
-
|
1786
|
-
<p>Set reference to the table this row belongs to without adding the row to
|
1787
|
-
the table</p>
|
1788
|
-
|
1789
|
-
|
1790
|
-
</div>
|
1791
|
-
</div>
|
1792
|
-
<div class="tags">
|
1793
|
-
<p class="tag_title">Parameters:</p>
|
1794
|
-
<ul class="param">
|
1795
|
-
|
1796
|
-
<li>
|
1797
|
-
|
1798
|
-
<span class='name'>t</span>
|
1799
|
-
|
1800
|
-
|
1801
|
-
<span class='type'>(<tt><span class='object_link'><a href="Table.html" title="Workbook::Table (class)">Workbook::Table</a></span></tt>)</span>
|
1802
|
-
|
1803
|
-
|
1804
|
-
|
1805
|
-
—
|
1806
|
-
<div class='inline'>
|
1807
|
-
<p>the table this row belongs to</p>
|
1808
|
-
</div>
|
1809
|
-
|
1810
|
-
</li>
|
1811
|
-
|
1812
|
-
</ul>
|
1813
|
-
|
1814
|
-
|
1815
|
-
</div><table class="source_code">
|
1816
|
-
<tr>
|
1817
|
-
<td>
|
1818
|
-
<pre class="lines">
|
1819
|
-
|
1820
|
-
|
1821
|
-
45
|
1822
|
-
46
|
1823
|
-
47</pre>
|
1824
|
-
</td>
|
1825
|
-
<td>
|
1826
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/row.rb', line 45</span>
|
1827
|
-
|
1828
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_set_table'>set_table</span><span class='lparen'>(</span><span class='id identifier rubyid_t'>t</span><span class='rparen'>)</span>
|
1829
|
-
<span class='ivar'>@table</span> <span class='op'>=</span> <span class='id identifier rubyid_t'>t</span>
|
1830
|
-
<span class='kw'>end</span></pre>
|
1831
|
-
</td>
|
1832
|
-
</tr>
|
1833
|
-
</table>
|
1834
|
-
</div>
|
1835
|
-
|
1836
|
-
<div class="method_details ">
|
1837
|
-
<h3 class="signature " id="table-instance_method">
|
1838
|
-
|
1839
|
-
- (<tt><span class='object_link'><a href="Table.html" title="Workbook::Table (class)">Workbook::Table</a></span></tt>) <strong>table</strong>
|
1840
|
-
|
1841
|
-
|
1842
|
-
|
1843
|
-
|
1844
|
-
|
1845
|
-
</h3><div class="docstring">
|
1846
|
-
<div class="discussion">
|
1847
|
-
|
1848
|
-
<p>Returns the table this row belongs to</p>
|
1849
|
-
|
1850
|
-
|
1851
|
-
</div>
|
1852
|
-
</div>
|
1853
|
-
<div class="tags">
|
1854
|
-
|
1855
|
-
<p class="tag_title">Returns:</p>
|
1856
|
-
<ul class="return">
|
1857
|
-
|
1858
|
-
<li>
|
1859
|
-
|
1860
|
-
|
1861
|
-
<span class='type'>(<tt><span class='object_link'><a href="Table.html" title="Workbook::Table (class)">Workbook::Table</a></span></tt>)</span>
|
1862
|
-
|
1863
|
-
|
1864
|
-
|
1865
|
-
—
|
1866
|
-
<div class='inline'>
|
1867
|
-
<p>the table this row belongs to</p>
|
1868
|
-
</div>
|
1869
|
-
|
1870
|
-
</li>
|
1871
|
-
|
1872
|
-
</ul>
|
1873
|
-
|
1874
|
-
</div><table class="source_code">
|
1875
|
-
<tr>
|
1876
|
-
<td>
|
1877
|
-
<pre class="lines">
|
1878
|
-
|
1879
|
-
|
1880
|
-
38
|
1881
|
-
39
|
1882
|
-
40</pre>
|
1883
|
-
</td>
|
1884
|
-
<td>
|
1885
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/row.rb', line 38</span>
|
1886
|
-
|
1887
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_table'>table</span>
|
1888
|
-
<span class='ivar'>@table</span>
|
1889
|
-
<span class='kw'>end</span></pre>
|
1890
|
-
</td>
|
1891
|
-
</tr>
|
1892
|
-
</table>
|
1893
|
-
</div>
|
1894
|
-
|
1895
|
-
<div class="method_details ">
|
1896
|
-
<h3 class="signature " id="table=-instance_method">
|
1897
|
-
|
1898
|
-
- (<tt>Object</tt>) <strong>table=</strong>(t)
|
1899
|
-
|
1900
|
-
|
1901
|
-
|
1902
|
-
|
1903
|
-
|
1904
|
-
</h3><div class="docstring">
|
1905
|
-
<div class="discussion">
|
1906
|
-
|
1907
|
-
<p>Set reference to the table this row belongs to and add the row to this
|
1908
|
-
table</p>
|
1909
|
-
|
1910
|
-
|
1911
|
-
</div>
|
1912
|
-
</div>
|
1913
|
-
<div class="tags">
|
1914
|
-
<p class="tag_title">Parameters:</p>
|
1915
|
-
<ul class="param">
|
1916
|
-
|
1917
|
-
<li>
|
1918
|
-
|
1919
|
-
<span class='name'>t</span>
|
1920
|
-
|
1921
|
-
|
1922
|
-
<span class='type'>(<tt><span class='object_link'><a href="Table.html" title="Workbook::Table (class)">Workbook::Table</a></span></tt>)</span>
|
1923
|
-
|
1924
|
-
|
1925
|
-
|
1926
|
-
—
|
1927
|
-
<div class='inline'>
|
1928
|
-
<p>the table this row belongs to</p>
|
1929
|
-
</div>
|
1930
|
-
|
1931
|
-
</li>
|
1932
|
-
|
1933
|
-
</ul>
|
1934
|
-
|
1935
|
-
<p class="tag_title">Raises:</p>
|
1936
|
-
<ul class="raise">
|
1937
|
-
|
1938
|
-
<li>
|
1939
|
-
|
1940
|
-
|
1941
|
-
<span class='type'>(<tt>ArgumentError</tt>)</span>
|
1942
|
-
|
1943
|
-
|
1944
|
-
|
1945
|
-
</li>
|
1946
|
-
|
1947
|
-
</ul>
|
1948
|
-
|
1949
|
-
</div><table class="source_code">
|
1950
|
-
<tr>
|
1951
|
-
<td>
|
1952
|
-
<pre class="lines">
|
1953
|
-
|
1954
|
-
|
1955
|
-
52
|
1956
|
-
53
|
1957
|
-
54
|
1958
|
-
55
|
1959
|
-
56
|
1960
|
-
57
|
1961
|
-
58</pre>
|
1962
|
-
</td>
|
1963
|
-
<td>
|
1964
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/row.rb', line 52</span>
|
1965
|
-
|
1966
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_table='>table=</span> <span class='id identifier rubyid_t'>t</span>
|
1967
|
-
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>table should be a Workbook::Table (you passed a </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='rbrace'>}</span><span class='tstring_content'>)</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Workbook</span><span class='op'>::</span><span class='const'>Table</span><span class='rparen'>)</span> <span class='kw'>or</span> <span class='id identifier rubyid_t'>t</span> <span class='op'>==</span> <span class='kw'>nil</span>
|
1968
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_t'>t</span>
|
1969
|
-
<span class='ivar'>@table</span> <span class='op'>=</span> <span class='id identifier rubyid_t'>t</span>
|
1970
|
-
<span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span> <span class='comment'>#unless table.index(self) and self.placeholder?
|
1971
|
-
</span> <span class='kw'>end</span>
|
1972
|
-
<span class='kw'>end</span></pre>
|
1973
|
-
</td>
|
1974
|
-
</tr>
|
1975
|
-
</table>
|
1976
|
-
</div>
|
1977
|
-
|
1978
|
-
<div class="method_details ">
|
1979
|
-
<h3 class="signature " id="table_header_keys-instance_method">
|
1980
|
-
|
1981
|
-
- (<tt>Object</tt>) <strong>table_header_keys</strong>
|
1982
|
-
|
1983
|
-
|
1984
|
-
|
1985
|
-
|
1986
|
-
|
1987
|
-
</h3><table class="source_code">
|
1988
|
-
<tr>
|
1989
|
-
<td>
|
1990
|
-
<pre class="lines">
|
1991
|
-
|
1992
|
-
|
1993
|
-
156
|
1994
|
-
157
|
1995
|
-
158</pre>
|
1996
|
-
</td>
|
1997
|
-
<td>
|
1998
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/row.rb', line 156</span>
|
1999
|
-
|
2000
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_table_header_keys'>table_header_keys</span>
|
2001
|
-
<span class='id identifier rubyid_table'>table</span><span class='period'>.</span><span class='id identifier rubyid_header'>header</span><span class='period'>.</span><span class='id identifier rubyid_to_symbols'>to_symbols</span>
|
2002
|
-
<span class='kw'>end</span></pre>
|
2003
|
-
</td>
|
2004
|
-
</tr>
|
2005
|
-
</table>
|
2006
|
-
</div>
|
2007
|
-
|
2008
|
-
<div class="method_details ">
|
2009
|
-
<h3 class="signature " id="to_a-instance_method">
|
2010
|
-
|
2011
|
-
- (<tt>Array<<span class='object_link'><a href="Cell.html" title="Workbook::Cell (class)">Workbook::Cell</a></span>></tt>) <strong>to_a</strong>
|
2012
|
-
|
2013
|
-
|
2014
|
-
|
2015
|
-
|
2016
|
-
|
2017
|
-
</h3><div class="docstring">
|
2018
|
-
<div class="discussion">
|
2019
|
-
|
2020
|
-
<p>Converts the row to an array of Workbook::Cell's</p>
|
2021
|
-
|
2022
|
-
|
2023
|
-
</div>
|
2024
|
-
</div>
|
2025
|
-
<div class="tags">
|
2026
|
-
|
2027
|
-
<p class="tag_title">Returns:</p>
|
2028
|
-
<ul class="return">
|
2029
|
-
|
2030
|
-
<li>
|
2031
|
-
|
2032
|
-
|
2033
|
-
<span class='type'>(<tt>Array<<span class='object_link'><a href="Cell.html" title="Workbook::Cell (class)">Workbook::Cell</a></span>></tt>)</span>
|
2034
|
-
|
2035
|
-
|
2036
|
-
|
2037
|
-
—
|
2038
|
-
<div class='inline'>
|
2039
|
-
<p>returns row as an array of symbols</p>
|
2040
|
-
</div>
|
2041
|
-
|
2042
|
-
</li>
|
2043
|
-
|
2044
|
-
</ul>
|
2045
|
-
|
2046
|
-
</div><table class="source_code">
|
2047
|
-
<tr>
|
2048
|
-
<td>
|
2049
|
-
<pre class="lines">
|
2050
|
-
|
2051
|
-
|
2052
|
-
152
|
2053
|
-
153
|
2054
|
-
154</pre>
|
2055
|
-
</td>
|
2056
|
-
<td>
|
2057
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/row.rb', line 152</span>
|
2058
|
-
|
2059
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_to_a'>to_a</span>
|
2060
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span> <span class='id identifier rubyid_c'>c</span><span class='rbrace'>}</span>
|
2061
|
-
<span class='kw'>end</span></pre>
|
2062
|
-
</td>
|
2063
|
-
</tr>
|
2064
|
-
</table>
|
2065
|
-
</div>
|
2066
|
-
|
2067
|
-
<div class="method_details ">
|
2068
|
-
<h3 class="signature " id="to_hash-instance_method">
|
2069
|
-
|
2070
|
-
- (<tt>Hash</tt>) <strong>to_hash</strong>
|
2071
|
-
|
2072
|
-
|
2073
|
-
|
2074
|
-
|
2075
|
-
|
2076
|
-
</h3><div class="docstring">
|
2077
|
-
<div class="discussion">
|
2078
|
-
|
2079
|
-
<p>Returns a hash representation of this row</p>
|
2080
|
-
|
2081
|
-
|
2082
|
-
</div>
|
2083
|
-
</div>
|
2084
|
-
<div class="tags">
|
2085
|
-
|
2086
|
-
<p class="tag_title">Returns:</p>
|
2087
|
-
<ul class="return">
|
2088
|
-
|
2089
|
-
<li>
|
2090
|
-
|
2091
|
-
|
2092
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
2093
|
-
|
2094
|
-
|
2095
|
-
|
2096
|
-
</li>
|
2097
|
-
|
2098
|
-
</ul>
|
2099
|
-
|
2100
|
-
</div><table class="source_code">
|
2101
|
-
<tr>
|
2102
|
-
<td>
|
2103
|
-
<pre class="lines">
|
2104
|
-
|
2105
|
-
|
2106
|
-
163
|
2107
|
-
164
|
2108
|
-
165
|
2109
|
-
166
|
2110
|
-
167
|
2111
|
-
168
|
2112
|
-
169
|
2113
|
-
170</pre>
|
2114
|
-
</td>
|
2115
|
-
<td>
|
2116
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/row.rb', line 163</span>
|
2117
|
-
|
2118
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_to_hash'>to_hash</span>
|
2119
|
-
<span class='kw'>return</span> <span class='ivar'>@hash</span> <span class='kw'>if</span> <span class='ivar'>@hash</span>
|
2120
|
-
<span class='id identifier rubyid_keys'>keys</span> <span class='op'>=</span> <span class='id identifier rubyid_table_header_keys'>table_header_keys</span>
|
2121
|
-
<span class='id identifier rubyid_values'>values</span> <span class='op'>=</span> <span class='kw'>self</span>
|
2122
|
-
<span class='ivar'>@hash</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
2123
|
-
<span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_each_with_index'>each_with_index</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span> <span class='ivar'>@hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span><span class='op'>=</span><span class='id identifier rubyid_values'>values</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span><span class='rbrace'>}</span>
|
2124
|
-
<span class='kw'>return</span> <span class='ivar'>@hash</span>
|
2125
|
-
<span class='kw'>end</span></pre>
|
2126
|
-
</td>
|
2127
|
-
</tr>
|
2128
|
-
</table>
|
2129
|
-
</div>
|
2130
|
-
|
2131
|
-
<div class="method_details ">
|
2132
|
-
<h3 class="signature " id="to_symbols-instance_method">
|
2133
|
-
|
2134
|
-
- (<tt>Array<Symbol></tt>) <strong>to_symbols</strong>
|
2135
|
-
|
2136
|
-
|
2137
|
-
|
2138
|
-
|
2139
|
-
|
2140
|
-
</h3><div class="docstring">
|
2141
|
-
<div class="discussion">
|
2142
|
-
|
2143
|
-
<p>Converts a row to an array of symbol representations of the row content,
|
2144
|
-
see also: Workbook::Cell#to_sym</p>
|
2145
|
-
|
2146
|
-
|
2147
|
-
</div>
|
2148
|
-
</div>
|
2149
|
-
<div class="tags">
|
2150
|
-
|
2151
|
-
<p class="tag_title">Returns:</p>
|
2152
|
-
<ul class="return">
|
2153
|
-
|
2154
|
-
<li>
|
2155
|
-
|
2156
|
-
|
2157
|
-
<span class='type'>(<tt>Array<Symbol></tt>)</span>
|
2158
|
-
|
2159
|
-
|
2160
|
-
|
2161
|
-
—
|
2162
|
-
<div class='inline'>
|
2163
|
-
<p>returns row as an array of symbols</p>
|
2164
|
-
</div>
|
2165
|
-
|
2166
|
-
</li>
|
2167
|
-
|
2168
|
-
</ul>
|
2169
|
-
|
2170
|
-
</div><table class="source_code">
|
2171
|
-
<tr>
|
2172
|
-
<td>
|
2173
|
-
<pre class="lines">
|
2174
|
-
|
2175
|
-
|
2176
|
-
146
|
2177
|
-
147
|
2178
|
-
148</pre>
|
2179
|
-
</td>
|
2180
|
-
<td>
|
2181
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/row.rb', line 146</span>
|
2182
|
-
|
2183
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_to_symbols'>to_symbols</span>
|
2184
|
-
<span class='id identifier rubyid_collect'>collect</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_c'>c</span><span class='op'>|</span> <span class='id identifier rubyid_c'>c</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbrace'>}</span>
|
2185
|
-
<span class='kw'>end</span></pre>
|
2186
|
-
</td>
|
2187
|
-
</tr>
|
2188
|
-
</table>
|
2189
|
-
</div>
|
2190
|
-
|
2191
|
-
<div class="method_details ">
|
2192
|
-
<h3 class="signature " id="trim-instance_method">
|
2193
|
-
|
2194
|
-
- (<tt><span class='object_link'><a href="" title="Workbook::Row (class)">Workbook::Row</a></span></tt>) <strong>trim</strong>(desired_length = nil)
|
2195
|
-
|
2196
|
-
|
2197
|
-
|
2198
|
-
|
2199
|
-
|
2200
|
-
</h3><div class="docstring">
|
2201
|
-
<div class="discussion">
|
2202
|
-
|
2203
|
-
<p>remove all the trailing nil-cells (returning a trimmed clone)</p>
|
2204
|
-
|
2205
|
-
|
2206
|
-
</div>
|
2207
|
-
</div>
|
2208
|
-
<div class="tags">
|
2209
|
-
<p class="tag_title">Parameters:</p>
|
2210
|
-
<ul class="param">
|
2211
|
-
|
2212
|
-
<li>
|
2213
|
-
|
2214
|
-
<span class='name'>desired_length</span>
|
2215
|
-
|
2216
|
-
|
2217
|
-
<span class='type'>(<tt>Integer</tt>)</span>
|
2218
|
-
|
2219
|
-
|
2220
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
2221
|
-
|
2222
|
-
|
2223
|
-
—
|
2224
|
-
<div class='inline'>
|
2225
|
-
<p>of the new row</p>
|
2226
|
-
</div>
|
2227
|
-
|
2228
|
-
</li>
|
2229
|
-
|
2230
|
-
</ul>
|
2231
|
-
|
2232
|
-
<p class="tag_title">Returns:</p>
|
2233
|
-
<ul class="return">
|
2234
|
-
|
2235
|
-
<li>
|
2236
|
-
|
2237
|
-
|
2238
|
-
<span class='type'>(<tt><span class='object_link'><a href="" title="Workbook::Row (class)">Workbook::Row</a></span></tt>)</span>
|
2239
|
-
|
2240
|
-
|
2241
|
-
|
2242
|
-
—
|
2243
|
-
<div class='inline'>
|
2244
|
-
<p>a trimmed clone of the array</p>
|
2245
|
-
</div>
|
2246
|
-
|
2247
|
-
</li>
|
2248
|
-
|
2249
|
-
</ul>
|
2250
|
-
|
2251
|
-
</div><table class="source_code">
|
2252
|
-
<tr>
|
2253
|
-
<td>
|
2254
|
-
<pre class="lines">
|
2255
|
-
|
2256
|
-
|
2257
|
-
207
|
2258
|
-
208
|
2259
|
-
209</pre>
|
2260
|
-
</td>
|
2261
|
-
<td>
|
2262
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/row.rb', line 207</span>
|
2263
|
-
|
2264
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_trim'>trim</span><span class='lparen'>(</span><span class='id identifier rubyid_desired_length'>desired_length</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
|
2265
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_clone'>clone</span><span class='period'>.</span><span class='id identifier rubyid_trim!'>trim!</span><span class='lparen'>(</span><span class='id identifier rubyid_desired_length'>desired_length</span><span class='rparen'>)</span>
|
2266
|
-
<span class='kw'>end</span></pre>
|
2267
|
-
</td>
|
2268
|
-
</tr>
|
2269
|
-
</table>
|
2270
|
-
</div>
|
2271
|
-
|
2272
|
-
<div class="method_details ">
|
2273
|
-
<h3 class="signature " id="trim!-instance_method">
|
2274
|
-
|
2275
|
-
- (<tt><span class='object_link'><a href="" title="Workbook::Row (class)">Workbook::Row</a></span></tt>) <strong>trim!</strong>(desired_length = nil)
|
2276
|
-
|
2277
|
-
|
2278
|
-
|
2279
|
-
|
2280
|
-
|
2281
|
-
</h3><div class="docstring">
|
2282
|
-
<div class="discussion">
|
2283
|
-
|
2284
|
-
<p>remove all the trailing nil-cells (returning a trimmed self)</p>
|
2285
|
-
|
2286
|
-
|
2287
|
-
</div>
|
2288
|
-
</div>
|
2289
|
-
<div class="tags">
|
2290
|
-
<p class="tag_title">Parameters:</p>
|
2291
|
-
<ul class="param">
|
2292
|
-
|
2293
|
-
<li>
|
2294
|
-
|
2295
|
-
<span class='name'>desired_length</span>
|
2296
|
-
|
2297
|
-
|
2298
|
-
<span class='type'>(<tt>Integer</tt>)</span>
|
2299
|
-
|
2300
|
-
|
2301
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
2302
|
-
|
2303
|
-
|
2304
|
-
—
|
2305
|
-
<div class='inline'>
|
2306
|
-
<p>of the new row</p>
|
2307
|
-
</div>
|
2308
|
-
|
2309
|
-
</li>
|
2310
|
-
|
2311
|
-
</ul>
|
2312
|
-
|
2313
|
-
<p class="tag_title">Returns:</p>
|
2314
|
-
<ul class="return">
|
2315
|
-
|
2316
|
-
<li>
|
2317
|
-
|
2318
|
-
|
2319
|
-
<span class='type'>(<tt><span class='object_link'><a href="" title="Workbook::Row (class)">Workbook::Row</a></span></tt>)</span>
|
2320
|
-
|
2321
|
-
|
2322
|
-
|
2323
|
-
—
|
2324
|
-
<div class='inline'>
|
2325
|
-
<p>self</p>
|
2326
|
-
</div>
|
2327
|
-
|
2328
|
-
</li>
|
2329
|
-
|
2330
|
-
</ul>
|
2331
|
-
|
2332
|
-
</div><table class="source_code">
|
2333
|
-
<tr>
|
2334
|
-
<td>
|
2335
|
-
<pre class="lines">
|
2336
|
-
|
2337
|
-
|
2338
|
-
215
|
2339
|
-
216
|
2340
|
-
217
|
2341
|
-
218
|
2342
|
-
219
|
2343
|
-
220
|
2344
|
-
221
|
2345
|
-
222
|
2346
|
-
223
|
2347
|
-
224
|
2348
|
-
225
|
2349
|
-
226
|
2350
|
-
227
|
2351
|
-
228
|
2352
|
-
229
|
2353
|
-
230
|
2354
|
-
231</pre>
|
2355
|
-
</td>
|
2356
|
-
<td>
|
2357
|
-
<pre class="code"><span class="info file"># File 'lib/workbook/row.rb', line 215</span>
|
2358
|
-
|
2359
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_trim!'>trim!</span><span class='lparen'>(</span><span class='id identifier rubyid_desired_length'>desired_length</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
|
2360
|
-
<span class='id identifier rubyid_self_count'>self_count</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span><span class='op'>-</span><span class='int'>1</span>
|
2361
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span><span class='period'>.</span><span class='id identifier rubyid_times'>times</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_index'>index</span><span class='op'>|</span>
|
2362
|
-
<span class='id identifier rubyid_index'>index</span> <span class='op'>=</span> <span class='id identifier rubyid_self_count'>self_count</span> <span class='op'>-</span> <span class='id identifier rubyid_index'>index</span>
|
2363
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_desired_length'>desired_length</span> <span class='kw'>and</span> <span class='id identifier rubyid_index'>index</span> <span class='op'><</span> <span class='id identifier rubyid_desired_length'>desired_length</span>
|
2364
|
-
<span class='kw'>break</span>
|
2365
|
-
<span class='kw'>elsif</span> <span class='id identifier rubyid_desired_length'>desired_length</span> <span class='kw'>and</span> <span class='id identifier rubyid_index'>index</span> <span class='op'>>=</span> <span class='id identifier rubyid_desired_length'>desired_length</span>
|
2366
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_delete_at'>delete_at</span><span class='lparen'>(</span><span class='id identifier rubyid_index'>index</span><span class='rparen'>)</span>
|
2367
|
-
<span class='kw'>elsif</span> <span class='kw'>self</span><span class='lbracket'>[</span><span class='id identifier rubyid_index'>index</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
2368
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_delete_at'>delete_at</span><span class='lparen'>(</span><span class='id identifier rubyid_index'>index</span><span class='rparen'>)</span>
|
2369
|
-
<span class='kw'>else</span>
|
2370
|
-
<span class='kw'>break</span>
|
2371
|
-
<span class='kw'>end</span>
|
2372
|
-
<span class='kw'>end</span>
|
2373
|
-
<span class='lparen'>(</span><span class='id identifier rubyid_desired_length'>desired_length</span> <span class='op'>-</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_times'>times</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_a'>a</span><span class='op'>|</span> <span class='kw'>self</span> <span class='op'><<</span> <span class='lparen'>(</span><span class='const'>Workbook</span><span class='op'>::</span><span class='const'>Cell</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>nil</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='rbrace'>}</span> <span class='kw'>if</span> <span class='id identifier rubyid_desired_length'>desired_length</span> <span class='kw'>and</span> <span class='lparen'>(</span><span class='id identifier rubyid_desired_length'>desired_length</span> <span class='op'>-</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span><span class='rparen'>)</span> <span class='op'>></span> <span class='int'>0</span>
|
2374
|
-
<span class='kw'>self</span>
|
2375
|
-
<span class='kw'>end</span></pre>
|
2376
|
-
</td>
|
2377
|
-
</tr>
|
2378
|
-
</table>
|
2379
|
-
</div>
|
2380
|
-
|
2381
|
-
</div>
|
2382
|
-
|
2383
|
-
</div>
|
2384
|
-
|
2385
|
-
<div id="footer">
|
2386
|
-
Generated on Sun May 19 23:16:30 2013 by
|
2387
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
2388
|
-
0.8.5.2 (ruby-1.9.3).
|
2389
|
-
</div>
|
2390
|
-
|
2391
|
-
</body>
|
2392
|
-
</html>
|