axlsx 1.0.8 → 1.0.9

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.
Files changed (128) hide show
  1. data/CHANGELOG.md +14 -0
  2. data/README.md +22 -21
  3. data/Rakefile +1 -1
  4. data/axlsx.gemspec +36 -0
  5. data/doc/Axlsx.html +373 -559
  6. data/doc/Axlsx/App.html +257 -360
  7. data/doc/Axlsx/Axis.html +113 -144
  8. data/doc/Axlsx/Bar3DChart.html +122 -152
  9. data/doc/Axlsx/BarSeries.html +67 -81
  10. data/doc/Axlsx/Border.html +96 -119
  11. data/doc/Axlsx/BorderPr.html +89 -114
  12. data/doc/Axlsx/CatAxis.html +79 -104
  13. data/doc/Axlsx/CatAxisData.html +40 -54
  14. data/doc/Axlsx/Cell.html +193 -679
  15. data/doc/Axlsx/CellAlignment.html +116 -157
  16. data/doc/Axlsx/CellProtection.html +50 -68
  17. data/doc/Axlsx/CellStyle.html +78 -106
  18. data/doc/Axlsx/Chart.html +361 -432
  19. data/doc/Axlsx/Color.html +56 -78
  20. data/doc/Axlsx/ContentType.html +28 -41
  21. data/doc/Axlsx/Core.html +43 -55
  22. data/doc/Axlsx/DataTypeValidator.html +34 -43
  23. data/doc/Axlsx/Default.html +55 -81
  24. data/doc/Axlsx/Drawing.html +322 -412
  25. data/doc/Axlsx/Fill.html +34 -47
  26. data/doc/Axlsx/Font.html +157 -207
  27. data/doc/Axlsx/GradientFill.html +90 -122
  28. data/doc/Axlsx/GradientStop.html +36 -50
  29. data/doc/Axlsx/GraphicFrame.html +106 -130
  30. data/doc/Axlsx/Line3DChart.html +108 -134
  31. data/doc/Axlsx/LineSeries.html +58 -67
  32. data/doc/Axlsx/Marker.html +84 -111
  33. data/doc/Axlsx/NumFmt.html +83 -102
  34. data/doc/Axlsx/OneCellAnchor.html +158 -196
  35. data/doc/Axlsx/Override.html +60 -92
  36. data/doc/Axlsx/Package.html +190 -759
  37. data/doc/Axlsx/PatternFill.html +78 -99
  38. data/doc/Axlsx/Pic.html +451 -405
  39. data/doc/Axlsx/Pie3DChart.html +33 -42
  40. data/doc/Axlsx/PieSeries.html +68 -80
  41. data/doc/Axlsx/RegexValidator.html +15 -20
  42. data/doc/Axlsx/Relationship.html +49 -66
  43. data/doc/Axlsx/Relationships.html +28 -41
  44. data/doc/Axlsx/RestrictionValidator.html +23 -32
  45. data/doc/Axlsx/Row.html +132 -161
  46. data/doc/Axlsx/Scaling.html +71 -90
  47. data/doc/Axlsx/SerAxis.html +61 -79
  48. data/doc/Axlsx/Series.html +125 -201
  49. data/doc/Axlsx/SeriesTitle.html +26 -31
  50. data/doc/Axlsx/Styles.html +286 -355
  51. data/doc/Axlsx/TableStyle.html +62 -87
  52. data/doc/Axlsx/TableStyleElement.html +84 -104
  53. data/doc/Axlsx/TableStyles.html +59 -82
  54. data/doc/Axlsx/Title.html +58 -155
  55. data/doc/Axlsx/TwoCellAnchor.html +165 -204
  56. data/doc/Axlsx/ValAxis.html +39 -53
  57. data/doc/Axlsx/ValAxisData.html +29 -39
  58. data/doc/Axlsx/View3D.html +93 -122
  59. data/doc/Axlsx/Workbook.html +359 -362
  60. data/doc/Axlsx/Worksheet.html +471 -816
  61. data/doc/Axlsx/Xf.html +341 -296
  62. data/doc/_index.html +7 -11
  63. data/doc/class_list.html +1 -1
  64. data/doc/file.LICENSE.html +86 -0
  65. data/doc/file.README.html +105 -107
  66. data/doc/file_list.html +3 -0
  67. data/doc/frames.html +1 -1
  68. data/doc/index.html +105 -107
  69. data/doc/method_list.html +426 -602
  70. data/doc/top-level-namespace.html +3 -3
  71. data/examples/example.rb +20 -1
  72. data/lib/axlsx.rb +20 -15
  73. data/lib/axlsx/content_type/default.rb +8 -3
  74. data/lib/axlsx/content_type/override.rb +11 -4
  75. data/lib/axlsx/doc_props/app.rb +53 -23
  76. data/lib/axlsx/drawing/axis.rb +16 -5
  77. data/lib/axlsx/drawing/bar_3D_chart.rb +15 -7
  78. data/lib/axlsx/drawing/bar_series.rb +7 -5
  79. data/lib/axlsx/drawing/cat_axis.rb +10 -3
  80. data/lib/axlsx/drawing/chart.rb +21 -15
  81. data/lib/axlsx/drawing/drawing.rb +16 -30
  82. data/lib/axlsx/drawing/graphic_frame.rb +2 -4
  83. data/lib/axlsx/drawing/line_3D_chart.rb +5 -2
  84. data/lib/axlsx/drawing/line_series.rb +6 -5
  85. data/lib/axlsx/drawing/marker.rb +9 -5
  86. data/lib/axlsx/drawing/one_cell_anchor.rb +7 -7
  87. data/lib/axlsx/drawing/pic.rb +29 -37
  88. data/lib/axlsx/drawing/pie_series.rb +7 -5
  89. data/lib/axlsx/drawing/scaling.rb +11 -5
  90. data/lib/axlsx/drawing/ser_axis.rb +6 -2
  91. data/lib/axlsx/drawing/series.rb +11 -11
  92. data/lib/axlsx/drawing/series_title.rb +1 -1
  93. data/lib/axlsx/drawing/title.rb +5 -12
  94. data/lib/axlsx/drawing/two_cell_anchor.rb +2 -3
  95. data/lib/axlsx/drawing/val_axis.rb +2 -2
  96. data/lib/axlsx/drawing/view_3D.rb +16 -9
  97. data/lib/axlsx/package.rb +25 -27
  98. data/lib/axlsx/rels/relationship.rb +4 -2
  99. data/lib/axlsx/stylesheet/border.rb +9 -4
  100. data/lib/axlsx/stylesheet/border_pr.rb +7 -4
  101. data/lib/axlsx/stylesheet/cell_alignment.rb +18 -9
  102. data/lib/axlsx/stylesheet/cell_protection.rb +5 -2
  103. data/lib/axlsx/stylesheet/cell_style.rb +12 -7
  104. data/lib/axlsx/stylesheet/color.rb +8 -6
  105. data/lib/axlsx/stylesheet/fill.rb +2 -1
  106. data/lib/axlsx/stylesheet/font.rb +24 -13
  107. data/lib/axlsx/stylesheet/gradient_fill.rb +16 -10
  108. data/lib/axlsx/stylesheet/gradient_stop.rb +5 -3
  109. data/lib/axlsx/stylesheet/num_fmt.rb +4 -2
  110. data/lib/axlsx/stylesheet/pattern_fill.rb +6 -4
  111. data/lib/axlsx/stylesheet/styles.rb +12 -12
  112. data/lib/axlsx/stylesheet/table_style.rb +6 -3
  113. data/lib/axlsx/stylesheet/table_style_element.rb +9 -4
  114. data/lib/axlsx/stylesheet/table_styles.rb +4 -4
  115. data/lib/axlsx/stylesheet/xf.rb +52 -31
  116. data/lib/axlsx/util/validators.rb +3 -3
  117. data/lib/axlsx/version.rb +1 -1
  118. data/lib/axlsx/workbook/workbook.rb +8 -9
  119. data/lib/axlsx/workbook/worksheet/cell.rb +25 -16
  120. data/lib/axlsx/workbook/worksheet/row.rb +2 -4
  121. data/lib/axlsx/workbook/worksheet/worksheet.rb +23 -32
  122. data/test/drawing/tc_one_cell_anchor.rb +1 -1
  123. metadata +135 -165
  124. data/doc/Axlsx/SimpleTypedList.html +0 -1686
  125. data/lib/schema/dc.xsd~ +0 -118
  126. data/lib/schema/dcterms.xsd~ +0 -331
  127. data/lib/schema/opc-coreProperties.xsd~ +0 -50
  128. data/test/drawing/tc_line_series.tc~ +0 -34
@@ -1,1686 +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: Axlsx::SimpleTypedList
8
-
9
- &mdash; Documentation by YARD 0.7.3
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
- relpath = '..';
19
- if (relpath != '') relpath += '/';
20
- </script>
21
-
22
- <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
23
-
24
- <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
25
-
26
-
27
- </head>
28
- <body>
29
- <script type="text/javascript" charset="utf-8">
30
- if (window.top.frames.main) document.body.className = 'frames';
31
- </script>
32
-
33
- <div id="header">
34
- <div id="menu">
35
-
36
- <a href="../_index.html">Index (S)</a> &raquo;
37
- <span class='title'><span class='object_link'><a href="../Axlsx.html" title="Axlsx (module)">Axlsx</a></span></span>
38
- &raquo;
39
- <span class="title">SimpleTypedList</span>
40
-
41
-
42
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
43
- </div>
44
-
45
- <div id="search">
46
-
47
- <a id="class_list_link" href="#">Class List</a>
48
-
49
- <a id="method_list_link" href="#">Method List</a>
50
-
51
- <a id="file_list_link" href="#">File List</a>
52
-
53
- </div>
54
- <div class="clear"></div>
55
- </div>
56
-
57
- <iframe id="search_frame"></iframe>
58
-
59
- <div id="content"><h1>Class: Axlsx::SimpleTypedList
60
-
61
-
62
-
63
- </h1>
64
-
65
- <dl class="box">
66
-
67
- <dt class="r1">Inherits:</dt>
68
- <dd class="r1">
69
- <span class="inheritName">Object</span>
70
-
71
- <ul class="fullTree">
72
- <li>Object</li>
73
-
74
- <li class="next">Axlsx::SimpleTypedList</li>
75
-
76
- </ul>
77
- <a href="#" class="inheritanceTree">show all</a>
78
-
79
- </dd>
80
-
81
-
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
- <dt class="r2 last">Defined in:</dt>
90
- <dd class="r2 last">lib/axlsx/util/simple_typed_list.rb</dd>
91
-
92
- </dl>
93
- <div class="clear"></div>
94
-
95
- <h2>Overview</h2><div class="docstring">
96
- <div class="discussion">
97
- <p>
98
- A SimpleTypedList is a type restrictive collection that allows some of the
99
- methods from Array and supports basic xml serialization.
100
- </p>
101
-
102
-
103
- </div>
104
- </div>
105
- <div class="tags">
106
-
107
-
108
- </div><div id="subclasses">
109
- <h2>Direct Known Subclasses</h2>
110
- <p class="children"><span class='object_link'><a href="CatAxisData.html" title="Axlsx::CatAxisData (class)">CatAxisData</a></span>, <span class='object_link'><a href="ContentType.html" title="Axlsx::ContentType (class)">ContentType</a></span>, <span class='object_link'><a href="Relationships.html" title="Axlsx::Relationships (class)">Relationships</a></span>, <span class='object_link'><a href="TableStyle.html" title="Axlsx::TableStyle (class)">TableStyle</a></span>, <span class='object_link'><a href="TableStyles.html" title="Axlsx::TableStyles (class)">TableStyles</a></span></p>
111
- </div>
112
-
113
-
114
- <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
115
- <ul class="summary">
116
-
117
- <li class="public ">
118
- <span class="summary_signature">
119
-
120
- <a href="#allowed_types-instance_method" title="#allowed_types (instance method)">- (Array) <strong>allowed_types</strong> </a>
121
-
122
-
123
-
124
- </span>
125
-
126
-
127
- <span class="note title readonly">readonly</span>
128
-
129
-
130
-
131
-
132
-
133
-
134
-
135
-
136
- <span class="summary_desc"><div class='inline'><p>
137
- The class constants of allowed types.
138
- </p>
139
- </div></span>
140
-
141
- </li>
142
-
143
-
144
- <li class="public ">
145
- <span class="summary_signature">
146
-
147
- <a href="#locked_at-instance_method" title="#locked_at (instance method)">- (Integer) <strong>locked_at</strong> </a>
148
-
149
-
150
-
151
- </span>
152
-
153
-
154
- <span class="note title readonly">readonly</span>
155
-
156
-
157
-
158
-
159
-
160
-
161
-
162
-
163
- <span class="summary_desc"><div class='inline'><p>
164
- The index below which items cannot be removed.
165
- </p>
166
- </div></span>
167
-
168
- </li>
169
-
170
-
171
- <li class="public ">
172
- <span class="summary_signature">
173
-
174
- <a href="#serialize_as-instance_method" title="#serialize_as (instance method)">- (String) <strong>serialize_as</strong> </a>
175
-
176
-
177
-
178
- </span>
179
-
180
-
181
- <span class="note title readonly">readonly</span>
182
-
183
-
184
-
185
-
186
-
187
-
188
-
189
-
190
- <span class="summary_desc"><div class='inline'><p>
191
- The tag name to use when serializing this object by default the parent node
192
- for all items in the list is the classname of the first allowed type with
193
- the first letter in lowercase.
194
- </p>
195
- </div></span>
196
-
197
- </li>
198
-
199
-
200
- </ul>
201
-
202
-
203
-
204
-
205
-
206
- <h2>
207
- Instance Method Summary
208
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
209
- </h2>
210
-
211
- <ul class="summary">
212
-
213
- <li class="public ">
214
- <span class="summary_signature">
215
-
216
- <a href="#%3C%3C-instance_method" title="#&lt;&lt; (instance method)">- (Integer) <strong>&lt;&lt;</strong>(v) </a>
217
-
218
-
219
-
220
- </span>
221
-
222
-
223
-
224
-
225
-
226
-
227
-
228
-
229
- <span class="summary_desc"><div class='inline'><p>
230
- Concat operator.
231
- </p>
232
- </div></span>
233
-
234
- </li>
235
-
236
-
237
- <li class="public ">
238
- <span class="summary_signature">
239
-
240
- <a href="#%3D%3D-instance_method" title="#== (instance method)">- (Object) <strong>==</strong>(v) </a>
241
-
242
-
243
-
244
- </span>
245
-
246
-
247
-
248
-
249
-
250
-
251
-
252
-
253
- <span class="summary_desc"><div class='inline'><p>
254
- override the equality method so that this object can be compared to a
255
- simple array.
256
- </p>
257
- </div></span>
258
-
259
- </li>
260
-
261
-
262
- <li class="public ">
263
- <span class="summary_signature">
264
-
265
- <a href="#%5B%5D%3D-instance_method" title="#[]= (instance method)">- (Object) <strong>[]=</strong>(index, v) </a>
266
-
267
-
268
-
269
- </span>
270
-
271
-
272
-
273
-
274
-
275
-
276
-
277
-
278
- <span class="summary_desc"><div class='inline'><p>
279
- positional assignment.
280
- </p>
281
- </div></span>
282
-
283
- </li>
284
-
285
-
286
- <li class="public ">
287
- <span class="summary_signature">
288
-
289
- <a href="#delete-instance_method" title="#delete (instance method)">- (Any) <strong>delete</strong>(v) </a>
290
-
291
-
292
-
293
- </span>
294
-
295
-
296
-
297
-
298
-
299
-
300
-
301
-
302
- <span class="summary_desc"><div class='inline'><p>
303
- delete the item from the list.
304
- </p>
305
- </div></span>
306
-
307
- </li>
308
-
309
-
310
- <li class="public ">
311
- <span class="summary_signature">
312
-
313
- <a href="#delete_at-instance_method" title="#delete_at (instance method)">- (Any) <strong>delete_at</strong>(index) </a>
314
-
315
-
316
-
317
- </span>
318
-
319
-
320
-
321
-
322
-
323
-
324
-
325
-
326
- <span class="summary_desc"><div class='inline'><p>
327
- delete the item from the list at the index position provided.
328
- </p>
329
- </div></span>
330
-
331
- </li>
332
-
333
-
334
- <li class="public ">
335
- <span class="summary_signature">
336
-
337
- <a href="#initialize-instance_method" title="#initialize (instance method)">- (SimpleTypedList) <strong>initialize</strong>(type, serialize_as = nil) </a>
338
-
339
-
340
-
341
- </span>
342
-
343
- <span class="note title constructor">constructor</span>
344
-
345
-
346
-
347
-
348
-
349
-
350
-
351
-
352
- <span class="summary_desc"><div class='inline'><p>
353
- Creats a new typed list.
354
- </p>
355
- </div></span>
356
-
357
- </li>
358
-
359
-
360
- <li class="public ">
361
- <span class="summary_signature">
362
-
363
- <a href="#lock-instance_method" title="#lock (instance method)">- (self) <strong>lock</strong> </a>
364
-
365
-
366
-
367
- </span>
368
-
369
-
370
-
371
-
372
-
373
-
374
-
375
-
376
- <span class="summary_desc"><div class='inline'><p>
377
- Lock this list at the current size.
378
- </p>
379
- </div></span>
380
-
381
- </li>
382
-
383
-
384
- <li class="public ">
385
- <span class="summary_signature">
386
-
387
- <a href="#method_missing-instance_method" title="#method_missing (instance method)">- (Object) <strong>method_missing</strong>(meth, *args, &amp;block) </a>
388
-
389
-
390
-
391
- </span>
392
-
393
-
394
-
395
-
396
-
397
-
398
-
399
-
400
- <span class="summary_desc"><div class='inline'><p>
401
- method_mission override to pass allowed methods to the list.
402
- </p>
403
- </div></span>
404
-
405
- </li>
406
-
407
-
408
- <li class="public ">
409
- <span class="summary_signature">
410
-
411
- <a href="#protected%3F-instance_method" title="#protected? (instance method)">- (Boolean) <strong>protected?</strong>(index) </a>
412
-
413
-
414
-
415
- </span>
416
-
417
-
418
-
419
-
420
-
421
-
422
-
423
-
424
- <span class="summary_desc"><div class='inline'><p>
425
- determines if the index is protected.
426
- </p>
427
- </div></span>
428
-
429
- </li>
430
-
431
-
432
- <li class="public ">
433
- <span class="summary_signature">
434
-
435
- <a href="#push-instance_method" title="#push (instance method)">- (Object) <strong>push</strong>(v) </a>
436
-
437
-
438
-
439
- </span>
440
-
441
-
442
-
443
-
444
-
445
-
446
-
447
-
448
- <span class="summary_desc"><div class='inline'><p>
449
- alternate of &lt;&lt; method.
450
- </p>
451
- </div></span>
452
-
453
- </li>
454
-
455
-
456
- <li class="public ">
457
- <span class="summary_signature">
458
-
459
- <a href="#to_xml-instance_method" title="#to_xml (instance method)">- (String) <strong>to_xml</strong>(xml) </a>
460
-
461
-
462
-
463
- </span>
464
-
465
-
466
-
467
-
468
-
469
-
470
-
471
-
472
- <span class="summary_desc"><div class='inline'><p>
473
- Serializes the list If the serialize_as property is set, it is used as the
474
- parent node name.
475
- </p>
476
- </div></span>
477
-
478
- </li>
479
-
480
-
481
- <li class="public ">
482
- <span class="summary_signature">
483
-
484
- <a href="#unlock-instance_method" title="#unlock (instance method)">- (self) <strong>unlock</strong> </a>
485
-
486
-
487
-
488
- </span>
489
-
490
-
491
-
492
-
493
-
494
-
495
-
496
-
497
- <span class="summary_desc"><div class='inline'><p>
498
- Unlock the list.
499
- </p>
500
- </div></span>
501
-
502
- </li>
503
-
504
-
505
- </ul>
506
-
507
-
508
- <div id="constructor_details" class="method_details_list">
509
- <h2>Constructor Details</h2>
510
-
511
- <div class="method_details first">
512
- <p class="signature first" id="initialize-instance_method">
513
-
514
- - (<tt><span class='object_link'><a href="" title="Axlsx::SimpleTypedList (class)">SimpleTypedList</a></span></tt>) <strong>initialize</strong>(type, serialize_as = nil)
515
-
516
-
517
-
518
- </p><div class="docstring">
519
- <div class="discussion">
520
- <p>
521
- Creats a new typed list
522
- </p>
523
-
524
-
525
- </div>
526
- </div>
527
- <div class="tags">
528
- <h3>Parameters:</h3>
529
- <ul class="param">
530
-
531
- <li>
532
-
533
- <span class='name'>type</span>
534
-
535
-
536
- <span class='type'>(<tt>Array</tt>, <tt>Class</tt>)</span>
537
-
538
-
539
-
540
- &mdash;
541
- <div class='inline'><p>
542
- An array of Class objects or a single Class object
543
- </p>
544
- </div>
545
-
546
- </li>
547
-
548
- <li>
549
-
550
- <span class='name'>serialize</span>
551
-
552
-
553
- <span class='type'>(<tt>String</tt>)</span>
554
-
555
-
556
-
557
- &mdash;
558
- <div class='inline'><p>
559
- The tag name to use in serialization
560
- </p>
561
- </div>
562
-
563
- </li>
564
-
565
- </ul>
566
-
567
- <h3>Raises:</h3>
568
- <ul class="raise">
569
-
570
- <li>
571
-
572
-
573
- <span class='type'>(<tt>ArgumentError</tt>)</span>
574
-
575
-
576
-
577
- &mdash;
578
- <div class='inline'><p>
579
- if all members of type are not Class objects
580
- </p>
581
- </div>
582
-
583
- </li>
584
-
585
- </ul>
586
-
587
- </div><table class="source_code">
588
- <tr>
589
- <td>
590
- <pre class="lines">
591
-
592
-
593
- 22
594
- 23
595
- 24
596
- 25
597
- 26
598
- 27
599
- 28
600
- 29
601
- 30
602
- 31
603
- 32
604
- 33</pre>
605
- </td>
606
- <td>
607
- <pre class="code"><span class="info file"># File 'lib/axlsx/util/simple_typed_list.rb', line 22</span>
608
-
609
- <span class='def def kw'>def</span> <span class='initialize identifier id'>initialize</span> <span class='type identifier id'>type</span><span class='comma token'>,</span> <span class='serialize_as identifier id'>serialize_as</span><span class='assign token'>=</span><span class='nil nil kw'>nil</span>
610
- <span class='if if kw'>if</span> <span class='type identifier id'>type</span><span class='dot token'>.</span><span class='is_a? fid id'>is_a?</span> <span class='Array constant id'>Array</span>
611
- <span class='type identifier id'>type</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='lbrace token'>{</span> <span class='bitor op'>|</span><span class='item identifier id'>item</span><span class='bitor op'>|</span> <span class='raise identifier id'>raise</span> <span class='ArgumentError constant id'>ArgumentError</span><span class='comma token'>,</span> <span class='string val'>&quot;All members of type must be Class objects&quot;</span> <span class='unless unless_mod kw'>unless</span> <span class='item identifier id'>item</span><span class='dot token'>.</span><span class='is_a? fid id'>is_a?</span> <span class='Class constant id'>Class</span> <span class='rbrace token'>}</span>
612
- <span class='@allowed_types ivar id'>@allowed_types</span> <span class='assign token'>=</span> <span class='type identifier id'>type</span>
613
- <span class='else else kw'>else</span>
614
- <span class='raise identifier id'>raise</span> <span class='ArgumentError constant id'>ArgumentError</span><span class='comma token'>,</span> <span class='string val'>&quot;Type must be a Class object or array of Class objects&quot;</span> <span class='unless unless_mod kw'>unless</span> <span class='type identifier id'>type</span><span class='dot token'>.</span><span class='is_a? fid id'>is_a?</span> <span class='Class constant id'>Class</span>
615
- <span class='@allowed_types ivar id'>@allowed_types</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='type identifier id'>type</span><span class='rbrack token'>]</span>
616
- <span class='end end kw'>end</span>
617
- <span class='@list ivar id'>@list</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='rbrack token'>]</span>
618
- <span class='@locked_at ivar id'>@locked_at</span> <span class='assign token'>=</span> <span class='nil nil kw'>nil</span>
619
- <span class='@serialize_as ivar id'>@serialize_as</span> <span class='assign token'>=</span> <span class='serialize_as identifier id'>serialize_as</span>
620
- <span class='end end kw'>end</span>
621
- </pre>
622
- </td>
623
- </tr>
624
- </table>
625
- </div>
626
-
627
- </div>
628
- <div id="method_missing_details" class="method_details_list">
629
- <h2>Dynamic Method Handling</h2>
630
- <p class="notice this">
631
- This class handles dynamic methods through the <tt>method_missing</tt> method
632
-
633
- </p>
634
-
635
- <div class="method_details first">
636
- <p class="signature first" id="method_missing-instance_method">
637
-
638
- - (<tt>Object</tt>) <strong>method_missing</strong>(meth, *args, &amp;block)
639
-
640
-
641
-
642
- </p><div class="docstring">
643
- <div class="discussion">
644
-
645
- <div class="note notetag">
646
- <strong>Note:</strong>
647
- <div class='inline'><p>
648
- the following methods are not allowed
649
- </p>
650
- <pre class="code">
651
- <span class='symbol val'>:replace</span>
652
- <span class='symbol val'>:insert</span>
653
- <span class='symbol val'>:collect!</span>
654
- <span class='symbol val'>:map!</span>
655
- <span class='symbol val'>:pop</span>
656
- <span class='symbol val'>:delete_if</span>
657
- <span class='symbol val'>:reverse!</span>
658
- <span class='symbol val'>:shift</span>
659
- <span class='symbol val'>:shuffle!</span>
660
- <span class='symbol val'>:slice!</span>
661
- <span class='symbol val'>:sort!</span>
662
- <span class='symbol val'>:uniq!</span>
663
- <span class='symbol val'>:unshift</span>
664
- <span class='symbol val'>:zip</span>
665
- <span class='symbol val'>:flatten!</span>
666
- <span class='symbol val'>:fill</span>
667
- <span class='symbol val'>:drop</span>
668
- <span class='symbol val'>:drop_while</span>
669
- <span class='symbol val'>:delete_if</span>
670
- <span class='symbol val'>:clear</span>
671
- </pre>
672
- </div>
673
- </div>
674
-
675
- <p>
676
- method_mission override to pass allowed methods to the list.
677
- </p>
678
-
679
-
680
- </div>
681
- </div>
682
- <div class="tags">
683
-
684
- <h3>Raises:</h3>
685
- <ul class="raise">
686
-
687
- <li>
688
-
689
-
690
- <span class='type'>(<tt>ArgumentError</tt>)</span>
691
-
692
-
693
-
694
- </li>
695
-
696
- </ul>
697
-
698
- </div><table class="source_code">
699
- <tr>
700
- <td>
701
- <pre class="lines">
702
-
703
-
704
- 131
705
- 132
706
- 133
707
- 134
708
- 135
709
- 136
710
- 137
711
- 138
712
- 139</pre>
713
- </td>
714
- <td>
715
- <pre class="code"><span class="info file"># File 'lib/axlsx/util/simple_typed_list.rb', line 131</span>
716
-
717
- <span class='def def kw'>def</span> <span class='method_missing identifier id'>method_missing</span><span class='lparen token'>(</span><span class='meth identifier id'>meth</span><span class='comma token'>,</span> <span class='mult op'>*</span><span class='args identifier id'>args</span><span class='comma token'>,</span> <span class='bitand op'>&amp;</span><span class='block identifier id'>block</span><span class='rparen token'>)</span>
718
- <span class='raise identifier id'>raise</span> <span class='ArgumentError constant id'>ArgumentError</span><span class='comma token'>,</span> <span class='dstring node'>&quot;#{meth} not supported&quot;</span> <span class='if if_mod kw'>if</span> <span class='lbrack token'>[</span><span class='symbol val'>:replace</span><span class='comma token'>,</span> <span class='symbol val'>:insert</span><span class='comma token'>,</span> <span class='symbol val'>:collect!</span><span class='comma token'>,</span> <span class='symbol val'>:map!</span><span class='comma token'>,</span> <span class='symbol val'>:pop</span><span class='comma token'>,</span> <span class='symbol val'>:delete_if</span><span class='comma token'>,</span> <span class='symbol val'>:reverse!</span><span class='comma token'>,</span> <span class='symbol val'>:shift</span><span class='comma token'>,</span> <span class='symbol val'>:shuffle!</span><span class='comma token'>,</span> <span class='symbol val'>:slice!</span><span class='comma token'>,</span> <span class='symbol val'>:sort!</span><span class='comma token'>,</span> <span class='symbol val'>:uniq!</span><span class='comma token'>,</span> <span class='symbol val'>:unshift</span><span class='comma token'>,</span> <span class='symbol val'>:zip</span><span class='comma token'>,</span> <span class='symbol val'>:flatten!</span><span class='comma token'>,</span> <span class='symbol val'>:fill</span><span class='comma token'>,</span> <span class='symbol val'>:drop</span><span class='comma token'>,</span> <span class='symbol val'>:drop_while</span><span class='comma token'>,</span> <span class='symbol val'>:delete_if</span><span class='comma token'>,</span> <span class='symbol val'>:clear</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='include? fid id'>include?</span> <span class='meth identifier id'>meth</span><span class='dot token'>.</span><span class='to_sym identifier id'>to_sym</span>
719
- <span class='if if kw'>if</span> <span class='@list ivar id'>@list</span><span class='dot token'>.</span><span class='respond_to? fid id'>respond_to?</span> <span class='meth identifier id'>meth</span>
720
- <span class='@list ivar id'>@list</span><span class='dot token'>.</span><span class='send identifier id'>send</span><span class='lparen token'>(</span><span class='meth identifier id'>meth</span><span class='comma token'>,</span> <span class='mult op'>*</span><span class='args identifier id'>args</span><span class='comma token'>,</span> <span class='bitand op'>&amp;</span><span class='block identifier id'>block</span><span class='rparen token'>)</span>
721
- <span class='else else kw'>else</span>
722
- <span class='puts identifier id'>puts</span> <span class='dstring node'>&quot;method:#{meth.inspect}&quot;</span>
723
- <span class='super super kw'>super</span>
724
- <span class='end end kw'>end</span>
725
- <span class='end end kw'>end</span>
726
- </pre>
727
- </td>
728
- </tr>
729
- </table>
730
- </div>
731
-
732
- </div>
733
-
734
- <div id="instance_attr_details" class="attr_details">
735
- <h2>Instance Attribute Details</h2>
736
-
737
-
738
- <span id=""></span>
739
- <span id="allowed_types-instance_method"></span>
740
- <div class="method_details first">
741
- <p class="signature first" id="allowed_types-instance_method">
742
-
743
- - (<tt>Array</tt>) <strong>allowed_types</strong> <span class="extras">(readonly)</span>
744
-
745
-
746
-
747
- </p><div class="docstring">
748
- <div class="discussion">
749
- <p>
750
- The class constants of allowed types
751
- </p>
752
-
753
-
754
- </div>
755
- </div>
756
- <div class="tags">
757
-
758
- <h3>Returns:</h3>
759
- <ul class="return">
760
-
761
- <li>
762
-
763
-
764
- <span class='type'>(<tt>Array</tt>)</span>
765
-
766
-
767
-
768
- </li>
769
-
770
- </ul>
771
-
772
- </div><table class="source_code">
773
- <tr>
774
- <td>
775
- <pre class="lines">
776
-
777
-
778
- 7
779
- 8
780
- 9</pre>
781
- </td>
782
- <td>
783
- <pre class="code"><span class="info file"># File 'lib/axlsx/util/simple_typed_list.rb', line 7</span>
784
-
785
- <span class='def def kw'>def</span> <span class='allowed_types identifier id'>allowed_types</span>
786
- <span class='@allowed_types ivar id'>@allowed_types</span>
787
- <span class='end end kw'>end</span>
788
- </pre>
789
- </td>
790
- </tr>
791
- </table>
792
- </div>
793
-
794
-
795
- <span id=""></span>
796
- <span id="locked_at-instance_method"></span>
797
- <div class="method_details ">
798
- <p class="signature " id="locked_at-instance_method">
799
-
800
- - (<tt>Integer</tt>) <strong>locked_at</strong> <span class="extras">(readonly)</span>
801
-
802
-
803
-
804
- </p><div class="docstring">
805
- <div class="discussion">
806
- <p>
807
- The index below which items cannot be removed
808
- </p>
809
-
810
-
811
- </div>
812
- </div>
813
- <div class="tags">
814
-
815
- <h3>Returns:</h3>
816
- <ul class="return">
817
-
818
- <li>
819
-
820
-
821
- <span class='type'>(<tt>Integer</tt>)</span>
822
-
823
-
824
-
825
- </li>
826
-
827
- </ul>
828
-
829
- </div><table class="source_code">
830
- <tr>
831
- <td>
832
- <pre class="lines">
833
-
834
-
835
- 11
836
- 12
837
- 13</pre>
838
- </td>
839
- <td>
840
- <pre class="code"><span class="info file"># File 'lib/axlsx/util/simple_typed_list.rb', line 11</span>
841
-
842
- <span class='def def kw'>def</span> <span class='locked_at identifier id'>locked_at</span>
843
- <span class='@locked_at ivar id'>@locked_at</span>
844
- <span class='end end kw'>end</span>
845
- </pre>
846
- </td>
847
- </tr>
848
- </table>
849
- </div>
850
-
851
-
852
- <span id=""></span>
853
- <span id="serialize_as-instance_method"></span>
854
- <div class="method_details ">
855
- <p class="signature " id="serialize_as-instance_method">
856
-
857
- - (<tt>String</tt>) <strong>serialize_as</strong> <span class="extras">(readonly)</span>
858
-
859
-
860
-
861
- </p><div class="docstring">
862
- <div class="discussion">
863
- <p>
864
- The tag name to use when serializing this object by default the parent node
865
- for all items in the list is the classname of the first allowed type with
866
- the first letter in lowercase.
867
- </p>
868
-
869
-
870
- </div>
871
- </div>
872
- <div class="tags">
873
-
874
- <h3>Returns:</h3>
875
- <ul class="return">
876
-
877
- <li>
878
-
879
-
880
- <span class='type'>(<tt>String</tt>)</span>
881
-
882
-
883
-
884
- </li>
885
-
886
- </ul>
887
-
888
- </div><table class="source_code">
889
- <tr>
890
- <td>
891
- <pre class="lines">
892
-
893
-
894
- 16
895
- 17
896
- 18</pre>
897
- </td>
898
- <td>
899
- <pre class="code"><span class="info file"># File 'lib/axlsx/util/simple_typed_list.rb', line 16</span>
900
-
901
- <span class='def def kw'>def</span> <span class='serialize_as identifier id'>serialize_as</span>
902
- <span class='@serialize_as ivar id'>@serialize_as</span>
903
- <span class='end end kw'>end</span>
904
- </pre>
905
- </td>
906
- </tr>
907
- </table>
908
- </div>
909
-
910
- </div>
911
-
912
-
913
- <div id="instance_method_details" class="method_details_list">
914
- <h2>Instance Method Details</h2>
915
-
916
-
917
- <div class="method_details first">
918
- <p class="signature first" id="<<-instance_method">
919
-
920
- - (<tt>Integer</tt>) <strong>&lt;&lt;</strong>(v)
921
-
922
-
923
-
924
- </p><div class="docstring">
925
- <div class="discussion">
926
- <p>
927
- Concat operator
928
- </p>
929
-
930
-
931
- </div>
932
- </div>
933
- <div class="tags">
934
- <h3>Parameters:</h3>
935
- <ul class="param">
936
-
937
- <li>
938
-
939
- <span class='name'>v</span>
940
-
941
-
942
- <span class='type'>(<tt>Any</tt>)</span>
943
-
944
-
945
-
946
- &mdash;
947
- <div class='inline'><p>
948
- the data to be added
949
- </p>
950
- </div>
951
-
952
- </li>
953
-
954
- </ul>
955
-
956
- <h3>Returns:</h3>
957
- <ul class="return">
958
-
959
- <li>
960
-
961
-
962
- <span class='type'>(<tt>Integer</tt>)</span>
963
-
964
-
965
-
966
- &mdash;
967
- <div class='inline'><p>
968
- returns the index of the item added.
969
- </p>
970
- </div>
971
-
972
- </li>
973
-
974
- </ul>
975
- <h3>Raises:</h3>
976
- <ul class="raise">
977
-
978
- <li>
979
-
980
-
981
- <span class='type'>(<tt>ArgumentError</tt>)</span>
982
-
983
-
984
-
985
- &mdash;
986
- <div class='inline'><p>
987
- if the value being added is not one fo the allowed types
988
- </p>
989
- </div>
990
-
991
- </li>
992
-
993
- </ul>
994
-
995
- </div><table class="source_code">
996
- <tr>
997
- <td>
998
- <pre class="lines">
999
-
1000
-
1001
- 53
1002
- 54
1003
- 55
1004
- 56
1005
- 57</pre>
1006
- </td>
1007
- <td>
1008
- <pre class="code"><span class="info file"># File 'lib/axlsx/util/simple_typed_list.rb', line 53</span>
1009
-
1010
- <span class='def def kw'>def</span> <span class='lshft op'>&lt;&lt;</span><span class='lparen token'>(</span><span class='v identifier id'>v</span><span class='rparen token'>)</span>
1011
- <span class='DataTypeValidator constant id'>DataTypeValidator</span><span class='dot token'>.</span><span class='validate identifier id'>validate</span> <span class='string val'>&quot;SimpleTypedList.&lt;&lt;&quot;</span><span class='comma token'>,</span> <span class='@allowed_types ivar id'>@allowed_types</span><span class='comma token'>,</span> <span class='v identifier id'>v</span>
1012
- <span class='@list ivar id'>@list</span> <span class='lshft op'>&lt;&lt;</span> <span class='v identifier id'>v</span>
1013
- <span class='@list ivar id'>@list</span><span class='dot token'>.</span><span class='size identifier id'>size</span> <span class='minus op'>-</span> <span class='integer val'>1</span>
1014
- <span class='end end kw'>end</span>
1015
- </pre>
1016
- </td>
1017
- </tr>
1018
- </table>
1019
- </div>
1020
-
1021
- <div class="method_details ">
1022
- <p class="signature " id="==-instance_method">
1023
-
1024
- - (<tt>Object</tt>) <strong>==</strong>(v)
1025
-
1026
-
1027
-
1028
- </p><div class="docstring">
1029
- <div class="discussion">
1030
- <p>
1031
- override the equality method so that this object can be compared to a
1032
- simple array. if this object&#8217;s list is equal to the specifiec array,
1033
- we return true.
1034
- </p>
1035
-
1036
-
1037
- </div>
1038
- </div>
1039
- <div class="tags">
1040
-
1041
-
1042
- </div><table class="source_code">
1043
- <tr>
1044
- <td>
1045
- <pre class="lines">
1046
-
1047
-
1048
- 105
1049
- 106
1050
- 107</pre>
1051
- </td>
1052
- <td>
1053
- <pre class="code"><span class="info file"># File 'lib/axlsx/util/simple_typed_list.rb', line 105</span>
1054
-
1055
- <span class='def def kw'>def</span> <span class='eq op'>==</span><span class='lparen token'>(</span><span class='v identifier id'>v</span><span class='rparen token'>)</span>
1056
- <span class='v identifier id'>v</span> <span class='eq op'>==</span> <span class='@list ivar id'>@list</span>
1057
- <span class='end end kw'>end</span>
1058
- </pre>
1059
- </td>
1060
- </tr>
1061
- </table>
1062
- </div>
1063
-
1064
- <div class="method_details ">
1065
- <p class="signature " id="[]=-instance_method">
1066
-
1067
- - (<tt>Object</tt>) <strong>[]=</strong>(index, v)
1068
-
1069
-
1070
-
1071
- </p><div class="docstring">
1072
- <div class="discussion">
1073
- <p>
1074
- positional assignment. Adds the item at the index specified
1075
- </p>
1076
-
1077
-
1078
- </div>
1079
- </div>
1080
- <div class="tags">
1081
- <h3>Parameters:</h3>
1082
- <ul class="param">
1083
-
1084
- <li>
1085
-
1086
- <span class='name'>index</span>
1087
-
1088
-
1089
- <span class='type'>(<tt>Integer</tt>)</span>
1090
-
1091
-
1092
-
1093
- </li>
1094
-
1095
- <li>
1096
-
1097
- <span class='name'>v</span>
1098
-
1099
-
1100
- <span class='type'>(<tt>Any</tt>)</span>
1101
-
1102
-
1103
-
1104
- </li>
1105
-
1106
- </ul>
1107
-
1108
- <h3>Raises:</h3>
1109
- <ul class="raise">
1110
-
1111
- <li>
1112
-
1113
-
1114
- <span class='type'>(<tt>ArgumentError</tt>)</span>
1115
-
1116
-
1117
-
1118
- &mdash;
1119
- <div class='inline'><p>
1120
- if the index is protected by locking
1121
- </p>
1122
- </div>
1123
-
1124
- </li>
1125
-
1126
- <li>
1127
-
1128
-
1129
- <span class='type'>(<tt>ArgumentError</tt>)</span>
1130
-
1131
-
1132
-
1133
- &mdash;
1134
- <div class='inline'><p>
1135
- if the item is not one of the allowed types
1136
- </p>
1137
- </div>
1138
-
1139
- </li>
1140
-
1141
- </ul>
1142
-
1143
- </div><table class="source_code">
1144
- <tr>
1145
- <td>
1146
- <pre class="lines">
1147
-
1148
-
1149
- 89
1150
- 90
1151
- 91
1152
- 92
1153
- 93
1154
- 94</pre>
1155
- </td>
1156
- <td>
1157
- <pre class="code"><span class="info file"># File 'lib/axlsx/util/simple_typed_list.rb', line 89</span>
1158
-
1159
- <span class='def def kw'>def</span> <span class='aset op'>[]=</span><span class='lparen token'>(</span><span class='index identifier id'>index</span><span class='comma token'>,</span> <span class='v identifier id'>v</span><span class='rparen token'>)</span>
1160
- <span class='DataTypeValidator constant id'>DataTypeValidator</span><span class='dot token'>.</span><span class='validate identifier id'>validate</span> <span class='string val'>&quot;SimpleTypedList.&lt;&lt;&quot;</span><span class='comma token'>,</span> <span class='@allowed_types ivar id'>@allowed_types</span><span class='comma token'>,</span> <span class='v identifier id'>v</span>
1161
- <span class='raise identifier id'>raise</span> <span class='ArgumentError constant id'>ArgumentError</span><span class='comma token'>,</span> <span class='string val'>&quot;Item is protected and cannot be changed&quot;</span> <span class='if if_mod kw'>if</span> <span class='protected? fid id'>protected?</span> <span class='index identifier id'>index</span>
1162
- <span class='@list ivar id'>@list</span><span class='lbrack token'>[</span><span class='index identifier id'>index</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='v identifier id'>v</span>
1163
- <span class='v identifier id'>v</span>
1164
- <span class='end end kw'>end</span>
1165
- </pre>
1166
- </td>
1167
- </tr>
1168
- </table>
1169
- </div>
1170
-
1171
- <div class="method_details ">
1172
- <p class="signature " id="delete-instance_method">
1173
-
1174
- - (<tt>Any</tt>) <strong>delete</strong>(v)
1175
-
1176
-
1177
-
1178
- </p><div class="docstring">
1179
- <div class="discussion">
1180
- <p>
1181
- delete the item from the list
1182
- </p>
1183
-
1184
-
1185
- </div>
1186
- </div>
1187
- <div class="tags">
1188
- <h3>Parameters:</h3>
1189
- <ul class="param">
1190
-
1191
- <li>
1192
-
1193
- <span class='name'>v</span>
1194
-
1195
-
1196
- <span class='type'>(<tt>Any</tt>)</span>
1197
-
1198
-
1199
-
1200
- &mdash;
1201
- <div class='inline'><p>
1202
- The item to be deleted.
1203
- </p>
1204
- </div>
1205
-
1206
- </li>
1207
-
1208
- </ul>
1209
-
1210
- <h3>Returns:</h3>
1211
- <ul class="return">
1212
-
1213
- <li>
1214
-
1215
-
1216
- <span class='type'>(<tt>Any</tt>)</span>
1217
-
1218
-
1219
-
1220
- &mdash;
1221
- <div class='inline'><p>
1222
- The item deleted
1223
- </p>
1224
- </div>
1225
-
1226
- </li>
1227
-
1228
- </ul>
1229
- <h3>Raises:</h3>
1230
- <ul class="raise">
1231
-
1232
- <li>
1233
-
1234
-
1235
- <span class='type'>(<tt>ArgumentError</tt>)</span>
1236
-
1237
-
1238
-
1239
- &mdash;
1240
- <div class='inline'><p>
1241
- if the item&#8217;s index is protected by locking
1242
- </p>
1243
- </div>
1244
-
1245
- </li>
1246
-
1247
- </ul>
1248
-
1249
- </div><table class="source_code">
1250
- <tr>
1251
- <td>
1252
- <pre class="lines">
1253
-
1254
-
1255
- 69
1256
- 70
1257
- 71
1258
- 72
1259
- 73</pre>
1260
- </td>
1261
- <td>
1262
- <pre class="code"><span class="info file"># File 'lib/axlsx/util/simple_typed_list.rb', line 69</span>
1263
-
1264
- <span class='def def kw'>def</span> <span class='delete identifier id'>delete</span><span class='lparen token'>(</span><span class='v identifier id'>v</span><span class='rparen token'>)</span>
1265
- <span class='return return kw'>return</span> <span class='unless unless_mod kw'>unless</span> <span class='@list ivar id'>@list</span><span class='dot token'>.</span><span class='include? fid id'>include?</span> <span class='v identifier id'>v</span>
1266
- <span class='raise identifier id'>raise</span> <span class='ArgumentError constant id'>ArgumentError</span><span class='comma token'>,</span> <span class='string val'>&quot;Item is protected and cannot be deleted&quot;</span> <span class='if if_mod kw'>if</span> <span class='protected? fid id'>protected?</span> <span class='@list ivar id'>@list</span><span class='dot token'>.</span><span class='index identifier id'>index</span><span class='lparen token'>(</span><span class='v identifier id'>v</span><span class='rparen token'>)</span>
1267
- <span class='@list ivar id'>@list</span><span class='dot token'>.</span><span class='delete identifier id'>delete</span> <span class='v identifier id'>v</span>
1268
- <span class='end end kw'>end</span>
1269
- </pre>
1270
- </td>
1271
- </tr>
1272
- </table>
1273
- </div>
1274
-
1275
- <div class="method_details ">
1276
- <p class="signature " id="delete_at-instance_method">
1277
-
1278
- - (<tt>Any</tt>) <strong>delete_at</strong>(index)
1279
-
1280
-
1281
-
1282
- </p><div class="docstring">
1283
- <div class="discussion">
1284
- <p>
1285
- delete the item from the list at the index position provided
1286
- </p>
1287
-
1288
-
1289
- </div>
1290
- </div>
1291
- <div class="tags">
1292
-
1293
- <h3>Returns:</h3>
1294
- <ul class="return">
1295
-
1296
- <li>
1297
-
1298
-
1299
- <span class='type'>(<tt>Any</tt>)</span>
1300
-
1301
-
1302
-
1303
- &mdash;
1304
- <div class='inline'><p>
1305
- The item deleted
1306
- </p>
1307
- </div>
1308
-
1309
- </li>
1310
-
1311
- </ul>
1312
- <h3>Raises:</h3>
1313
- <ul class="raise">
1314
-
1315
- <li>
1316
-
1317
-
1318
- <span class='type'>(<tt>ArgumentError</tt>)</span>
1319
-
1320
-
1321
-
1322
- &mdash;
1323
- <div class='inline'><p>
1324
- if the index is protected by locking
1325
- </p>
1326
- </div>
1327
-
1328
- </li>
1329
-
1330
- </ul>
1331
-
1332
- </div><table class="source_code">
1333
- <tr>
1334
- <td>
1335
- <pre class="lines">
1336
-
1337
-
1338
- 78
1339
- 79
1340
- 80
1341
- 81
1342
- 82</pre>
1343
- </td>
1344
- <td>
1345
- <pre class="code"><span class="info file"># File 'lib/axlsx/util/simple_typed_list.rb', line 78</span>
1346
-
1347
- <span class='def def kw'>def</span> <span class='delete_at identifier id'>delete_at</span><span class='lparen token'>(</span><span class='index identifier id'>index</span><span class='rparen token'>)</span>
1348
- <span class='@list ivar id'>@list</span><span class='lbrack token'>[</span><span class='index identifier id'>index</span><span class='rbrack token'>]</span>
1349
- <span class='raise identifier id'>raise</span> <span class='ArgumentError constant id'>ArgumentError</span><span class='comma token'>,</span> <span class='string val'>&quot;Item is protected and cannot be deleted&quot;</span> <span class='if if_mod kw'>if</span> <span class='protected? fid id'>protected?</span> <span class='index identifier id'>index</span>
1350
- <span class='@list ivar id'>@list</span><span class='dot token'>.</span><span class='delete_at identifier id'>delete_at</span> <span class='index identifier id'>index</span>
1351
- <span class='end end kw'>end</span>
1352
- </pre>
1353
- </td>
1354
- </tr>
1355
- </table>
1356
- </div>
1357
-
1358
- <div class="method_details ">
1359
- <p class="signature " id="lock-instance_method">
1360
-
1361
- - (<tt>self</tt>) <strong>lock</strong>
1362
-
1363
-
1364
-
1365
- </p><div class="docstring">
1366
- <div class="discussion">
1367
- <p>
1368
- Lock this list at the current size
1369
- </p>
1370
-
1371
-
1372
- </div>
1373
- </div>
1374
- <div class="tags">
1375
-
1376
- <h3>Returns:</h3>
1377
- <ul class="return">
1378
-
1379
- <li>
1380
-
1381
-
1382
- <span class='type'>(<tt>self</tt>)</span>
1383
-
1384
-
1385
-
1386
- </li>
1387
-
1388
- </ul>
1389
-
1390
- </div><table class="source_code">
1391
- <tr>
1392
- <td>
1393
- <pre class="lines">
1394
-
1395
-
1396
- 37
1397
- 38
1398
- 39
1399
- 40</pre>
1400
- </td>
1401
- <td>
1402
- <pre class="code"><span class="info file"># File 'lib/axlsx/util/simple_typed_list.rb', line 37</span>
1403
-
1404
- <span class='def def kw'>def</span> <span class='lock identifier id'>lock</span>
1405
- <span class='@locked_at ivar id'>@locked_at</span> <span class='assign token'>=</span> <span class='@list ivar id'>@list</span><span class='dot token'>.</span><span class='size identifier id'>size</span>
1406
- <span class='self self kw'>self</span>
1407
- <span class='end end kw'>end</span>
1408
- </pre>
1409
- </td>
1410
- </tr>
1411
- </table>
1412
- </div>
1413
-
1414
- <div class="method_details ">
1415
- <p class="signature " id="protected?-instance_method">
1416
-
1417
- - (<tt>Boolean</tt>) <strong>protected?</strong>(index)
1418
-
1419
-
1420
-
1421
- </p><div class="docstring">
1422
- <div class="discussion">
1423
- <p>
1424
- determines if the index is protected
1425
- </p>
1426
-
1427
-
1428
- </div>
1429
- </div>
1430
- <div class="tags">
1431
- <h3>Parameters:</h3>
1432
- <ul class="param">
1433
-
1434
- <li>
1435
-
1436
- <span class='name'>index</span>
1437
-
1438
-
1439
- <span class='type'>(<tt>Integer</tt>)</span>
1440
-
1441
-
1442
-
1443
- </li>
1444
-
1445
- </ul>
1446
-
1447
- <h3>Returns:</h3>
1448
- <ul class="return">
1449
-
1450
- <li>
1451
-
1452
-
1453
- <span class='type'>(<tt>Boolean</tt>)</span>
1454
-
1455
-
1456
-
1457
- </li>
1458
-
1459
- </ul>
1460
-
1461
- </div><table class="source_code">
1462
- <tr>
1463
- <td>
1464
- <pre class="lines">
1465
-
1466
-
1467
- 98
1468
- 99
1469
- 100
1470
- 101</pre>
1471
- </td>
1472
- <td>
1473
- <pre class="code"><span class="info file"># File 'lib/axlsx/util/simple_typed_list.rb', line 98</span>
1474
-
1475
- <span class='def def kw'>def</span> <span class='protected? fid id'>protected?</span> <span class='index identifier id'>index</span>
1476
- <span class='return return kw'>return</span> <span class='false false kw'>false</span> <span class='unless unless_mod kw'>unless</span> <span class='@locked_at ivar id'>@locked_at</span><span class='dot token'>.</span><span class='is_a? fid id'>is_a?</span> <span class='Fixnum constant id'>Fixnum</span>
1477
- <span class='index identifier id'>index</span> <span class='lt op'>&lt;</span> <span class='@locked_at ivar id'>@locked_at</span>
1478
- <span class='end end kw'>end</span>
1479
- </pre>
1480
- </td>
1481
- </tr>
1482
- </table>
1483
- </div>
1484
-
1485
- <div class="method_details ">
1486
- <p class="signature " id="push-instance_method">
1487
-
1488
- - (<tt>Object</tt>) <strong>push</strong>(v)
1489
-
1490
-
1491
-
1492
- </p><div class="docstring">
1493
- <div class="discussion">
1494
- <p>
1495
- alternate of &lt;&lt; method
1496
- </p>
1497
-
1498
-
1499
- </div>
1500
- </div>
1501
- <div class="tags">
1502
-
1503
-
1504
- <h3>See Also:</h3>
1505
- <ul class="see">
1506
-
1507
- <li>&lt;&lt;</li>
1508
-
1509
- </ul>
1510
-
1511
- </div><table class="source_code">
1512
- <tr>
1513
- <td>
1514
- <pre class="lines">
1515
-
1516
-
1517
- 61
1518
- 62
1519
- 63</pre>
1520
- </td>
1521
- <td>
1522
- <pre class="code"><span class="info file"># File 'lib/axlsx/util/simple_typed_list.rb', line 61</span>
1523
-
1524
- <span class='def def kw'>def</span> <span class='push identifier id'>push</span><span class='lparen token'>(</span><span class='v identifier id'>v</span><span class='rparen token'>)</span>
1525
- <span class='self self kw'>self</span><span class='dot token'>.</span><span class='lshft op'>&lt;&lt;</span> <span class='v identifier id'>v</span>
1526
- <span class='end end kw'>end</span>
1527
- </pre>
1528
- </td>
1529
- </tr>
1530
- </table>
1531
- </div>
1532
-
1533
- <div class="method_details ">
1534
- <p class="signature " id="to_xml-instance_method">
1535
-
1536
- - (<tt>String</tt>) <strong>to_xml</strong>(xml)
1537
-
1538
-
1539
-
1540
- </p><div class="docstring">
1541
- <div class="discussion">
1542
- <p>
1543
- Serializes the list If the serialize_as property is set, it is used as the
1544
- parent node name. If the serialize_as property is nil, the first item in
1545
- the list of allowed_types will be used, having the first letter of the
1546
- class changed to lower case.
1547
- </p>
1548
-
1549
-
1550
- </div>
1551
- </div>
1552
- <div class="tags">
1553
- <h3>Parameters:</h3>
1554
- <ul class="param">
1555
-
1556
- <li>
1557
-
1558
- <span class='name'>xml</span>
1559
-
1560
-
1561
- <span class='type'>(<tt>Nokogiri::XML::Builder</tt>)</span>
1562
-
1563
-
1564
-
1565
- &mdash;
1566
- <div class='inline'><p>
1567
- The document builder instance this objects xml will be added to.
1568
- </p>
1569
- </div>
1570
-
1571
- </li>
1572
-
1573
- </ul>
1574
-
1575
- <h3>Returns:</h3>
1576
- <ul class="return">
1577
-
1578
- <li>
1579
-
1580
-
1581
- <span class='type'>(<tt>String</tt>)</span>
1582
-
1583
-
1584
-
1585
- </li>
1586
-
1587
- </ul>
1588
-
1589
- </div><table class="source_code">
1590
- <tr>
1591
- <td>
1592
- <pre class="lines">
1593
-
1594
-
1595
- 146
1596
- 147
1597
- 148
1598
- 149
1599
- 150
1600
- 151
1601
- 152</pre>
1602
- </td>
1603
- <td>
1604
- <pre class="code"><span class="info file"># File 'lib/axlsx/util/simple_typed_list.rb', line 146</span>
1605
-
1606
- <span class='def def kw'>def</span> <span class='to_xml identifier id'>to_xml</span><span class='lparen token'>(</span><span class='xml identifier id'>xml</span><span class='rparen token'>)</span>
1607
- <span class='classname identifier id'>classname</span> <span class='assign token'>=</span> <span class='@allowed_types ivar id'>@allowed_types</span><span class='lbrack token'>[</span><span class='integer val'>0</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='name identifier id'>name</span><span class='dot token'>.</span><span class='split identifier id'>split</span><span class='lparen token'>(</span><span class='string val'>'::'</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='last identifier id'>last</span>
1608
- <span class='el_name identifier id'>el_name</span> <span class='assign token'>=</span> <span class='serialize_as identifier id'>serialize_as</span> <span class='orop op'>||</span> <span class='lparen token'>(</span><span class='classname identifier id'>classname</span><span class='lbrack token'>[</span><span class='integer val'>0</span><span class='comma token'>,</span><span class='integer val'>1</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='downcase identifier id'>downcase</span> <span class='plus op'>+</span> <span class='classname identifier id'>classname</span><span class='lbrack token'>[</span><span class='float val'>1</span><span class='dot2 op'>..</span><span class='integer val'>-1</span><span class='rbrack token'>]</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='pluralize identifier id'>pluralize</span>
1609
- <span class='xml identifier id'>xml</span><span class='dot token'>.</span><span class='send identifier id'>send</span><span class='lparen token'>(</span><span class='el_name identifier id'>el_name</span><span class='comma token'>,</span> <span class='symbol val'>:count=</span><span class='gt op'>&gt;</span><span class='@list ivar id'>@list</span><span class='dot token'>.</span><span class='size identifier id'>size</span><span class='rparen token'>)</span> <span class='lbrace token'>{</span>
1610
- <span class='@list ivar id'>@list</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='lbrace token'>{</span> <span class='bitor op'>|</span><span class='item identifier id'>item</span><span class='bitor op'>|</span> <span class='item identifier id'>item</span><span class='dot token'>.</span><span class='to_xml identifier id'>to_xml</span><span class='lparen token'>(</span><span class='xml identifier id'>xml</span><span class='rparen token'>)</span> <span class='rbrace token'>}</span>
1611
- <span class='rbrace token'>}</span>
1612
- <span class='end end kw'>end</span>
1613
- </pre>
1614
- </td>
1615
- </tr>
1616
- </table>
1617
- </div>
1618
-
1619
- <div class="method_details ">
1620
- <p class="signature " id="unlock-instance_method">
1621
-
1622
- - (<tt>self</tt>) <strong>unlock</strong>
1623
-
1624
-
1625
-
1626
- </p><div class="docstring">
1627
- <div class="discussion">
1628
- <p>
1629
- Unlock the list
1630
- </p>
1631
-
1632
-
1633
- </div>
1634
- </div>
1635
- <div class="tags">
1636
-
1637
- <h3>Returns:</h3>
1638
- <ul class="return">
1639
-
1640
- <li>
1641
-
1642
-
1643
- <span class='type'>(<tt>self</tt>)</span>
1644
-
1645
-
1646
-
1647
- </li>
1648
-
1649
- </ul>
1650
-
1651
- </div><table class="source_code">
1652
- <tr>
1653
- <td>
1654
- <pre class="lines">
1655
-
1656
-
1657
- 44
1658
- 45
1659
- 46
1660
- 47</pre>
1661
- </td>
1662
- <td>
1663
- <pre class="code"><span class="info file"># File 'lib/axlsx/util/simple_typed_list.rb', line 44</span>
1664
-
1665
- <span class='def def kw'>def</span> <span class='unlock identifier id'>unlock</span>
1666
- <span class='@locked_at ivar id'>@locked_at</span> <span class='assign token'>=</span> <span class='nil nil kw'>nil</span>
1667
- <span class='self self kw'>self</span>
1668
- <span class='end end kw'>end</span>
1669
- </pre>
1670
- </td>
1671
- </tr>
1672
- </table>
1673
- </div>
1674
-
1675
- </div>
1676
-
1677
- </div>
1678
-
1679
- <div id="footer">
1680
- Generated on Wed Nov 23 21:48:02 2011 by
1681
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1682
- 0.7.3 (ruby-1.8.7).
1683
- </div>
1684
-
1685
- </body>
1686
- </html>