axlsx 1.0.9 → 1.0.10a

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. data/Gemfile +3 -0
  2. data/Gemfile.lock +24 -0
  3. data/README.md +86 -1
  4. data/axlsx.gemspec +6 -10
  5. data/doc/Axlsx.html +557 -360
  6. data/doc/Axlsx/App.html +347 -244
  7. data/doc/Axlsx/Ar.html +200 -0
  8. data/doc/Axlsx/Ar/ClassMethods.html +192 -0
  9. data/doc/Axlsx/Ar/InstanceMethods.html +109 -0
  10. data/doc/Axlsx/Ar/SingletonMethods.html +304 -0
  11. data/doc/Axlsx/Axis.html +131 -98
  12. data/doc/Axlsx/Bar3DChart.html +138 -106
  13. data/doc/Axlsx/BarSeries.html +73 -54
  14. data/doc/Axlsx/Border.html +114 -87
  15. data/doc/Axlsx/BorderPr.html +107 -82
  16. data/doc/Axlsx/CatAxis.html +93 -68
  17. data/doc/Axlsx/CatAxisData.html +47 -38
  18. data/doc/Axlsx/Cell.html +642 -148
  19. data/doc/Axlsx/CellAlignment.html +152 -111
  20. data/doc/Axlsx/CellProtection.html +63 -45
  21. data/doc/Axlsx/CellStyle.html +101 -73
  22. data/doc/Axlsx/Chart.html +238 -179
  23. data/doc/Axlsx/Color.html +75 -53
  24. data/doc/Axlsx/ContentType.html +34 -26
  25. data/doc/Axlsx/Core.html +54 -42
  26. data/doc/Axlsx/DataTypeValidator.html +39 -30
  27. data/doc/Axlsx/Default.html +59 -43
  28. data/doc/Axlsx/Drawing.html +176 -128
  29. data/doc/Axlsx/Fill.html +46 -33
  30. data/doc/Axlsx/Font.html +197 -147
  31. data/doc/Axlsx/GradientFill.html +114 -82
  32. data/doc/Axlsx/GradientStop.html +47 -33
  33. data/doc/Axlsx/GraphicFrame.html +78 -60
  34. data/doc/Axlsx/Line3DChart.html +125 -97
  35. data/doc/Axlsx/LineSeries.html +60 -44
  36. data/doc/Axlsx/Marker.html +98 -71
  37. data/doc/Axlsx/NumFmt.html +99 -80
  38. data/doc/Axlsx/OneCellAnchor.html +126 -94
  39. data/doc/Axlsx/Override.html +59 -43
  40. data/doc/Axlsx/Package.html +269 -134
  41. data/doc/Axlsx/PatternFill.html +93 -72
  42. data/doc/Axlsx/Pic.html +202 -152
  43. data/doc/Axlsx/Pie3DChart.html +39 -30
  44. data/doc/Axlsx/PieSeries.html +72 -53
  45. data/doc/Axlsx/RegexValidator.html +19 -14
  46. data/doc/Axlsx/Relationship.html +60 -43
  47. data/doc/Axlsx/Relationships.html +34 -26
  48. data/doc/Axlsx/RestrictionValidator.html +31 -22
  49. data/doc/Axlsx/Row.html +241 -67
  50. data/doc/Axlsx/Scaling.html +80 -59
  51. data/doc/Axlsx/SerAxis.html +71 -51
  52. data/doc/Axlsx/Series.html +179 -51
  53. data/doc/Axlsx/SeriesTitle.html +29 -24
  54. data/doc/Axlsx/Styles.html +354 -285
  55. data/doc/Axlsx/TableStyle.html +74 -54
  56. data/doc/Axlsx/TableStyleElement.html +99 -79
  57. data/doc/Axlsx/TableStyles.html +65 -47
  58. data/doc/Axlsx/Title.html +66 -51
  59. data/doc/Axlsx/TwoCellAnchor.html +129 -96
  60. data/doc/Axlsx/ValAxis.html +52 -38
  61. data/doc/Axlsx/ValAxisData.html +32 -27
  62. data/doc/Axlsx/View3D.html +111 -80
  63. data/doc/Axlsx/Workbook.html +333 -272
  64. data/doc/Axlsx/Worksheet.html +1018 -266
  65. data/doc/Axlsx/Xf.html +188 -134
  66. data/doc/_index.html +44 -8
  67. data/doc/class_list.html +1 -1
  68. data/doc/file.LICENSE.html +28 -23
  69. data/doc/file.README.html +180 -91
  70. data/doc/index.html +180 -91
  71. data/doc/method_list.html +541 -421
  72. data/doc/top-level-namespace.html +2 -2
  73. data/examples/example.rb +70 -13
  74. data/lib/axlsx.rb +1 -0
  75. data/lib/axlsx/ar.rb +72 -0
  76. data/lib/axlsx/package.rb +8 -1
  77. data/lib/axlsx/util/simple_typed_list.rb +5 -0
  78. data/lib/axlsx/version.rb +1 -1
  79. data/lib/axlsx/workbook/workbook.rb +4 -2
  80. data/lib/axlsx/workbook/worksheet/row.rb +15 -0
  81. data/lib/axlsx/workbook/worksheet/worksheet.rb +44 -1
  82. data/test/workbook/worksheet/tc_row.rb +6 -0
  83. data/test/workbook/worksheet/tc_worksheet.rb +36 -0
  84. metadata +103 -59
@@ -99,13 +99,15 @@
99
99
 
100
100
  <div class="note notetag">
101
101
  <strong>Note:</strong>
102
- <div class='inline'>
103
- <p>The recommended way to manage series is to use Chart#add_series</p>
102
+ <div class='inline'><p>
103
+ The recommended way to manage series is to use Chart#add_series
104
+ </p>
104
105
  </div>
105
106
  </div>
106
107
 
107
-
108
- <p>A BarSeries defines the title, data and labels for bar charts</p>
108
+ <p>
109
+ A BarSeries defines the title, data and labels for bar charts
110
+ </p>
109
111
 
110
112
 
111
113
  </div>
@@ -150,8 +152,9 @@
150
152
 
151
153
 
152
154
 
153
- <span class="summary_desc"><div class='inline'>
154
- <p>The data for this series.</p>
155
+ <span class="summary_desc"><div class='inline'><p>
156
+ The data for this series.
157
+ </p>
155
158
  </div></span>
156
159
 
157
160
  </li>
@@ -176,8 +179,9 @@
176
179
 
177
180
 
178
181
 
179
- <span class="summary_desc"><div class='inline'>
180
- <p>The labels for this series.</p>
182
+ <span class="summary_desc"><div class='inline'><p>
183
+ The labels for this series.
184
+ </p>
181
185
  </div></span>
182
186
 
183
187
  </li>
@@ -202,9 +206,10 @@
202
206
 
203
207
 
204
208
 
205
- <span class="summary_desc"><div class='inline'>
206
- <p>The shabe of the bars or columns must be one of [:percentStacked,
207
- :clustered, :standard, :stacked].</p>
209
+ <span class="summary_desc"><div class='inline'><p>
210
+ The shabe of the bars or columns must be one of [:percentStacked,
211
+ :clustered, :standard, :stacked].
212
+ </p>
208
213
  </div></span>
209
214
 
210
215
  </li>
@@ -249,8 +254,9 @@
249
254
 
250
255
 
251
256
 
252
- <span class="summary_desc"><div class='inline'>
253
- <p>Creates a new series.</p>
257
+ <span class="summary_desc"><div class='inline'><p>
258
+ Creates a new series.
259
+ </p>
254
260
  </div></span>
255
261
 
256
262
  </li>
@@ -272,8 +278,9 @@
272
278
 
273
279
 
274
280
 
275
- <span class="summary_desc"><div class='inline'>
276
- <p>Serializes the series.</p>
281
+ <span class="summary_desc"><div class='inline'><p>
282
+ Serializes the series.
283
+ </p>
277
284
  </div></span>
278
285
 
279
286
  </li>
@@ -304,8 +311,9 @@
304
311
 
305
312
  </p><div class="docstring">
306
313
  <div class="discussion">
307
-
308
- <p>Creates a new series</p>
314
+ <p>
315
+ Creates a new series
316
+ </p>
309
317
 
310
318
 
311
319
  </div>
@@ -337,8 +345,9 @@
337
345
 
338
346
 
339
347
  &mdash;
340
- <div class='inline'>
341
- <p>a customizable set of options</p>
348
+ <div class='inline'><p>
349
+ a customizable set of options
350
+ </p>
342
351
  </div>
343
352
 
344
353
  </li>
@@ -409,12 +418,13 @@
409
418
  <td>
410
419
  <pre class="code"><span class="info file"># File 'lib/axlsx/drawing/bar_series.rb', line 28</span>
411
420
 
412
- <span class='kw'>def</span> <span class='id initialize'>initialize</span><span class='lparen'>(</span><span class='id chart'>chart</span><span class='comma'>,</span> <span class='id options'>options</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
413
- <span class='ivar'>@shape</span> <span class='op'>=</span> <span class='symbol'>:box</span>
414
- <span class='kw'>super</span><span class='lparen'>(</span><span class='id chart'>chart</span><span class='comma'>,</span> <span class='id options'>options</span><span class='rparen'>)</span>
415
- <span class='kw'>self</span><span class='period'>.</span><span class='id labels'>labels</span> <span class='op'>=</span> <span class='const'>CatAxisData</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='id options'>options</span><span class='lbracket'>[</span><span class='symbol'>:labels</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='symbol'>:labels</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id nil?'>nil?</span>
416
- <span class='kw'>self</span><span class='period'>.</span><span class='id data'>data</span> <span class='op'>=</span> <span class='const'>ValAxisData</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='id options'>options</span><span class='lbracket'>[</span><span class='symbol'>:data</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='symbol'>:data</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id nil?'>nil?</span>
417
- <span class='kw'>end</span></pre>
421
+ <span class='def def kw'>def</span> <span class='initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='chart identifier id'>chart</span><span class='comma token'>,</span> <span class='options identifier id'>options</span><span class='assign token'>=</span><span class='lbrace token'>{</span><span class='rbrace token'>}</span><span class='rparen token'>)</span>
422
+ <span class='@shape ivar id'>@shape</span> <span class='assign token'>=</span> <span class='symbol val'>:box</span>
423
+ <span class='super super kw'>super</span><span class='lparen token'>(</span><span class='chart identifier id'>chart</span><span class='comma token'>,</span> <span class='options identifier id'>options</span><span class='rparen token'>)</span>
424
+ <span class='self self kw'>self</span><span class='dot token'>.</span><span class='labels identifier id'>labels</span> <span class='assign token'>=</span> <span class='CatAxisData constant id'>CatAxisData</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:labels</span><span class='rbrack token'>]</span><span class='rparen token'>)</span> <span class='unless unless_mod kw'>unless</span> <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:labels</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='nil? fid id'>nil?</span>
425
+ <span class='self self kw'>self</span><span class='dot token'>.</span><span class='data identifier id'>data</span> <span class='assign token'>=</span> <span class='ValAxisData constant id'>ValAxisData</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:data</span><span class='rbrack token'>]</span><span class='rparen token'>)</span> <span class='unless unless_mod kw'>unless</span> <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:data</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='nil? fid id'>nil?</span>
426
+ <span class='end end kw'>end</span>
427
+ </pre>
418
428
  </td>
419
429
  </tr>
420
430
  </table>
@@ -437,8 +447,9 @@
437
447
 
438
448
  </p><div class="docstring">
439
449
  <div class="discussion">
440
-
441
- <p>The data for this series.</p>
450
+ <p>
451
+ The data for this series.
452
+ </p>
442
453
 
443
454
 
444
455
  </div>
@@ -472,9 +483,10 @@
472
483
  <td>
473
484
  <pre class="code"><span class="info file"># File 'lib/axlsx/drawing/bar_series.rb', line 11</span>
474
485
 
475
- <span class='kw'>def</span> <span class='id data'>data</span>
476
- <span class='ivar'>@data</span>
477
- <span class='kw'>end</span></pre>
486
+ <span class='def def kw'>def</span> <span class='data identifier id'>data</span>
487
+ <span class='@data ivar id'>@data</span>
488
+ <span class='end end kw'>end</span>
489
+ </pre>
478
490
  </td>
479
491
  </tr>
480
492
  </table>
@@ -492,8 +504,9 @@
492
504
 
493
505
  </p><div class="docstring">
494
506
  <div class="discussion">
495
-
496
- <p>The labels for this series.</p>
507
+ <p>
508
+ The labels for this series.
509
+ </p>
497
510
 
498
511
 
499
512
  </div>
@@ -527,9 +540,10 @@
527
540
  <td>
528
541
  <pre class="code"><span class="info file"># File 'lib/axlsx/drawing/bar_series.rb', line 15</span>
529
542
 
530
- <span class='kw'>def</span> <span class='id labels'>labels</span>
531
- <span class='ivar'>@labels</span>
532
- <span class='kw'>end</span></pre>
543
+ <span class='def def kw'>def</span> <span class='labels identifier id'>labels</span>
544
+ <span class='@labels ivar id'>@labels</span>
545
+ <span class='end end kw'>end</span>
546
+ </pre>
533
547
  </td>
534
548
  </tr>
535
549
  </table>
@@ -547,9 +561,10 @@
547
561
 
548
562
  </p><div class="docstring">
549
563
  <div class="discussion">
550
-
551
- <p>The shabe of the bars or columns must be one of [:percentStacked,
552
- :clustered, :standard, :stacked]</p>
564
+ <p>
565
+ The shabe of the bars or columns must be one of [:percentStacked,
566
+ :clustered, :standard, :stacked]
567
+ </p>
553
568
 
554
569
 
555
570
  </div>
@@ -583,9 +598,10 @@
583
598
  <td>
584
599
  <pre class="code"><span class="info file"># File 'lib/axlsx/drawing/bar_series.rb', line 20</span>
585
600
 
586
- <span class='kw'>def</span> <span class='id shape'>shape</span>
587
- <span class='ivar'>@shape</span>
588
- <span class='kw'>end</span></pre>
601
+ <span class='def def kw'>def</span> <span class='shape identifier id'>shape</span>
602
+ <span class='@shape ivar id'>@shape</span>
603
+ <span class='end end kw'>end</span>
604
+ </pre>
589
605
  </td>
590
606
  </tr>
591
607
  </table>
@@ -607,8 +623,9 @@
607
623
 
608
624
  </p><div class="docstring">
609
625
  <div class="discussion">
610
-
611
- <p>Serializes the series</p>
626
+ <p>
627
+ Serializes the series
628
+ </p>
612
629
 
613
630
 
614
631
  </div>
@@ -627,8 +644,9 @@
627
644
 
628
645
 
629
646
  &mdash;
630
- <div class='inline'>
631
- <p>The document builder instance this objects xml will be added to.</p>
647
+ <div class='inline'><p>
648
+ The document builder instance this objects xml will be added to.
649
+ </p>
632
650
  </div>
633
651
 
634
652
  </li>
@@ -666,13 +684,14 @@
666
684
  <td>
667
685
  <pre class="code"><span class="info file"># File 'lib/axlsx/drawing/bar_series.rb', line 45</span>
668
686
 
669
- <span class='kw'>def</span> <span class='id to_xml'>to_xml</span><span class='lparen'>(</span><span class='id xml'>xml</span><span class='rparen'>)</span>
670
- <span class='kw'>super</span><span class='lparen'>(</span><span class='id xml'>xml</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id xml_inner'>xml_inner</span><span class='op'>|</span>
671
- <span class='ivar'>@labels</span><span class='period'>.</span><span class='id to_xml'>to_xml</span><span class='lparen'>(</span><span class='id xml_inner'>xml_inner</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='ivar'>@labels</span><span class='period'>.</span><span class='id nil?'>nil?</span>
672
- <span class='ivar'>@data</span><span class='period'>.</span><span class='id to_xml'>to_xml</span><span class='lparen'>(</span><span class='id xml_inner'>xml_inner</span><span class='rparen'>)</span> <span class='kw'>unless</span> <span class='ivar'>@data</span><span class='period'>.</span><span class='id nil?'>nil?</span>
673
- <span class='id xml_inner'>xml_inner</span><span class='period'>.</span><span class='id send'>send</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>c:shape</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:val</span><span class='op'>=&gt;</span><span class='ivar'>@shape</span><span class='rparen'>)</span>
674
- <span class='kw'>end</span>
675
- <span class='kw'>end</span></pre>
687
+ <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>
688
+ <span class='super super kw'>super</span><span class='lparen token'>(</span><span class='xml identifier id'>xml</span><span class='rparen token'>)</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='xml_inner identifier id'>xml_inner</span><span class='bitor op'>|</span>
689
+ <span class='@labels ivar id'>@labels</span><span class='dot token'>.</span><span class='to_xml identifier id'>to_xml</span><span class='lparen token'>(</span><span class='xml_inner identifier id'>xml_inner</span><span class='rparen token'>)</span> <span class='unless unless_mod kw'>unless</span> <span class='@labels ivar id'>@labels</span><span class='dot token'>.</span><span class='nil? fid id'>nil?</span>
690
+ <span class='@data ivar id'>@data</span><span class='dot token'>.</span><span class='to_xml identifier id'>to_xml</span><span class='lparen token'>(</span><span class='xml_inner identifier id'>xml_inner</span><span class='rparen token'>)</span> <span class='unless unless_mod kw'>unless</span> <span class='@data ivar id'>@data</span><span class='dot token'>.</span><span class='nil? fid id'>nil?</span>
691
+ <span class='xml_inner identifier id'>xml_inner</span><span class='dot token'>.</span><span class='send identifier id'>send</span><span class='lparen token'>(</span><span class='string val'>'c:shape'</span><span class='comma token'>,</span> <span class='symbol val'>:val=</span><span class='gt op'>&gt;</span><span class='@shape ivar id'>@shape</span><span class='rparen token'>)</span>
692
+ <span class='end end kw'>end</span>
693
+ <span class='end end kw'>end</span>
694
+ </pre>
676
695
  </td>
677
696
  </tr>
678
697
  </table>
@@ -683,9 +702,9 @@
683
702
  </div>
684
703
 
685
704
  <div id="footer">
686
- Generated on Sat Nov 26 13:16:38 2011 by
705
+ Generated on Sun Nov 27 21:54:24 2011 by
687
706
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
688
- 0.7.3 (ruby-1.9.3).
707
+ 0.7.3 (ruby-1.8.7).
689
708
  </div>
690
709
 
691
710
  </body>
@@ -94,8 +94,9 @@
94
94
 
95
95
  <h2>Overview</h2><div class="docstring">
96
96
  <div class="discussion">
97
-
98
- <p>This class details a border used in Office Open XML spreadsheet styles.</p>
97
+ <p>
98
+ This class details a border used in Office Open XML spreadsheet styles.
99
+ </p>
99
100
 
100
101
 
101
102
  </div>
@@ -127,10 +128,11 @@
127
128
 
128
129
 
129
130
 
130
- <span class="summary_desc"><div class='inline'>
131
- <p>The diagonal down property for the border that indicates if the border
131
+ <span class="summary_desc"><div class='inline'><p>
132
+ The diagonal down property for the border that indicates if the border
132
133
  should include a diagonal line from the top left to the top right of the
133
- cell.</p>
134
+ cell.
135
+ </p>
134
136
  </div></span>
135
137
 
136
138
  </li>
@@ -155,9 +157,10 @@ cell.</p>
155
157
 
156
158
 
157
159
 
158
- <span class="summary_desc"><div class='inline'>
159
- <p>The diagonal up property for the border that indicates if the border should
160
- include a diagonal line from the bottom left to the top right of the cell.</p>
160
+ <span class="summary_desc"><div class='inline'><p>
161
+ The diagonal up property for the border that indicates if the border should
162
+ include a diagonal line from the bottom left to the top right of the cell.
163
+ </p>
161
164
  </div></span>
162
165
 
163
166
  </li>
@@ -182,10 +185,11 @@ include a diagonal line from the bottom left to the top right of the cell.</p>
182
185
 
183
186
 
184
187
 
185
- <span class="summary_desc"><div class='inline'>
186
- <p>The outline property for the border indicating that top, left, right and
188
+ <span class="summary_desc"><div class='inline'><p>
189
+ The outline property for the border indicating that top, left, right and
187
190
  bottom borders should only be applied to the outside border of a range of
188
- cells.</p>
191
+ cells.
192
+ </p>
189
193
  </div></span>
190
194
 
191
195
  </li>
@@ -210,8 +214,9 @@ cells.</p>
210
214
 
211
215
 
212
216
 
213
- <span class="summary_desc"><div class='inline'>
214
- <p>A list of BorderPr objects for this border.</p>
217
+ <span class="summary_desc"><div class='inline'><p>
218
+ A list of BorderPr objects for this border.
219
+ </p>
215
220
  </div></span>
216
221
 
217
222
  </li>
@@ -248,8 +253,9 @@ cells.</p>
248
253
 
249
254
 
250
255
 
251
- <span class="summary_desc"><div class='inline'>
252
- <p>Creates a new Border object.</p>
256
+ <span class="summary_desc"><div class='inline'><p>
257
+ Creates a new Border object.
258
+ </p>
253
259
  </div></span>
254
260
 
255
261
  </li>
@@ -271,8 +277,9 @@ cells.</p>
271
277
 
272
278
 
273
279
 
274
- <span class="summary_desc"><div class='inline'>
275
- <p>Serializes the border element.</p>
280
+ <span class="summary_desc"><div class='inline'><p>
281
+ Serializes the border element.
282
+ </p>
276
283
  </div></span>
277
284
 
278
285
  </li>
@@ -293,8 +300,9 @@ cells.</p>
293
300
 
294
301
  </p><div class="docstring">
295
302
  <div class="discussion">
296
-
297
- <p>Creates a new Border object</p>
303
+ <p>
304
+ Creates a new Border object
305
+ </p>
298
306
 
299
307
 
300
308
  </div>
@@ -304,18 +312,20 @@ cells.</p>
304
312
  <div class="examples">
305
313
  <h3>Examples:</h3>
306
314
 
307
- <h4><div class='inline'>
308
- <p>Making a border</p>
315
+ <h4><div class='inline'><p>
316
+ Making a border
317
+ </p>
309
318
  </div></h4>
310
- <pre class="example code">p = Package.new
311
- red_border = Border.new
312
- [:left, :right, :top, :bottom].each do |item|
313
- red_border.prs &lt;&lt; BorderPr.new(:name=&gt;item, :style=&gt;:thin, :color=&gt;Color.new(:rgb=&gt;&quot;FFFF0000&quot;)) #
314
- end
315
- # this sets red_border to be the index for the created border.
316
- red_border = p.workbook.styles.@borders &lt;&lt; red_border
317
- #used in row creation as follows. This will add a red border to each of the cells in the row.
318
- p.workbook.add_worksheet.rows &lt;&lt; :values=&gt;[1,2,3] :style=&gt;red_border</pre>
319
+ <pre class="example code"><span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
320
+ <span class='red_border identifier id'>red_border</span> <span class='assign token'>=</span> <span class='Border constant id'>Border</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
321
+ <span class='lbrack token'>[</span><span class='symbol val'>:left</span><span class='comma token'>,</span> <span class='symbol val'>:right</span><span class='comma token'>,</span> <span class='symbol val'>:top</span><span class='comma token'>,</span> <span class='symbol val'>:bottom</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='item identifier id'>item</span><span class='bitor op'>|</span>
322
+ <span class='red_border identifier id'>red_border</span><span class='dot token'>.</span><span class='prs identifier id'>prs</span> <span class='lshft op'>&lt;&lt;</span> <span class='BorderPr constant id'>BorderPr</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='symbol val'>:name=</span><span class='gt op'>&gt;</span><span class='item identifier id'>item</span><span class='comma token'>,</span> <span class='symbol val'>:style=</span><span class='gt op'>&gt;</span><span class='symbol val'>:thin</span><span class='comma token'>,</span> <span class='symbol val'>:color=</span><span class='gt op'>&gt;</span><span class='Color constant id'>Color</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='symbol val'>:rgb=</span><span class='gt op'>&gt;</span><span class='string val'>&quot;FFFF0000&quot;</span><span class='rparen token'>)</span><span class='rparen token'>)</span> <span class='comment val'># </span>
323
+ <span class='end end kw'>end</span>
324
+ <span class='comment val'># this sets red_border to be the index for the created border.</span>
325
+ <span class='red_border identifier id'>red_border</span> <span class='assign token'>=</span> <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='styles identifier id'>styles</span><span class='dot token'>.</span><span class='@borders ivar id'>@borders</span> <span class='lshft op'>&lt;&lt;</span> <span class='red_border identifier id'>red_border</span>
326
+ <span class='comment val'>#used in row creation as follows. This will add a red border to each of the cells in the row.</span>
327
+ <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span><span class='dot token'>.</span><span class='add_worksheet identifier id'>add_worksheet</span><span class='dot token'>.</span><span class='rows identifier id'>rows</span> <span class='lshft op'>&lt;&lt;</span> <span class='symbol val'>:values=</span><span class='gt op'>&gt;</span><span class='lbrack token'>[</span><span class='integer val'>1</span><span class='comma token'>,</span><span class='integer val'>2</span><span class='comma token'>,</span><span class='integer val'>3</span><span class='rbrack token'>]</span> <span class='symbol val'>:style=</span><span class='gt op'>&gt;</span><span class='red_border identifier id'>red_border</span>
328
+ </pre>
319
329
 
320
330
  </div>
321
331
  <h3>Parameters:</h3>
@@ -333,8 +343,9 @@ p.workbook.add_worksheet.rows &lt;&lt; :values=&gt;[1,2,3] :style=&gt;red_border
333
343
 
334
344
 
335
345
  &mdash;
336
- <div class='inline'>
337
- <p>a customizable set of options</p>
346
+ <div class='inline'><p>
347
+ a customizable set of options
348
+ </p>
338
349
  </div>
339
350
 
340
351
  </li>
@@ -394,12 +405,13 @@ p.workbook.add_worksheet.rows &lt;&lt; :values=&gt;[1,2,3] :style=&gt;red_border
394
405
  <td>
395
406
  <pre class="code"><span class="info file"># File 'lib/axlsx/stylesheet/border.rb', line 31</span>
396
407
 
397
- <span class='kw'>def</span> <span class='id initialize'>initialize</span><span class='lparen'>(</span><span class='id options'>options</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
398
- <span class='ivar'>@prs</span> <span class='op'>=</span> <span class='const'>SimpleTypedList</span><span class='period'>.</span><span class='id new'>new</span> <span class='const'>BorderPr</span>
399
- <span class='id options'>options</span><span class='period'>.</span><span class='id each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id o'>o</span><span class='op'>|</span>
400
- <span class='kw'>self</span><span class='period'>.</span><span class='id send'>send</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id o'>o</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id o'>o</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id respond_to?'>respond_to?</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id o'>o</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>&quot;</span></span>
401
- <span class='kw'>end</span>
402
- <span class='kw'>end</span></pre>
408
+ <span class='def def kw'>def</span> <span class='initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='options identifier id'>options</span><span class='assign token'>=</span><span class='lbrace token'>{</span><span class='rbrace token'>}</span><span class='rparen token'>)</span>
409
+ <span class='@prs ivar id'>@prs</span> <span class='assign token'>=</span> <span class='SimpleTypedList constant id'>SimpleTypedList</span><span class='dot token'>.</span><span class='new identifier id'>new</span> <span class='BorderPr constant id'>BorderPr</span>
410
+ <span class='options identifier id'>options</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='o identifier id'>o</span><span class='bitor op'>|</span>
411
+ <span class='self self kw'>self</span><span class='dot token'>.</span><span class='send identifier id'>send</span><span class='lparen token'>(</span><span class='dstring node'>&quot;#{o[0]}=&quot;</span><span class='comma token'>,</span> <span class='o identifier id'>o</span><span class='lbrack token'>[</span><span class='integer val'>1</span><span class='rbrack token'>]</span><span class='rparen token'>)</span> <span class='if if_mod kw'>if</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='respond_to? fid id'>respond_to?</span> <span class='dstring node'>&quot;#{o[0]}=&quot;</span>
412
+ <span class='end end kw'>end</span>
413
+ <span class='end end kw'>end</span>
414
+ </pre>
403
415
  </td>
404
416
  </tr>
405
417
  </table>
@@ -422,10 +434,11 @@ p.workbook.add_worksheet.rows &lt;&lt; :values=&gt;[1,2,3] :style=&gt;red_border
422
434
 
423
435
  </p><div class="docstring">
424
436
  <div class="discussion">
425
-
426
- <p>The diagonal down property for the border that indicates if the border
437
+ <p>
438
+ The diagonal down property for the border that indicates if the border
427
439
  should include a diagonal line from the top left to the top right of the
428
- cell.</p>
440
+ cell.
441
+ </p>
429
442
 
430
443
 
431
444
  </div>
@@ -443,10 +456,11 @@ cell.</p>
443
456
 
444
457
 
445
458
  &mdash;
446
- <div class='inline'>
447
- <p>The diagonal down property for the border that indicates if the border
459
+ <div class='inline'><p>
460
+ The diagonal down property for the border that indicates if the border
448
461
  should include a diagonal line from the top left to the top right of the
449
- cell.</p>
462
+ cell.
463
+ </p>
450
464
  </div>
451
465
 
452
466
  </li>
@@ -466,9 +480,10 @@ cell.</p>
466
480
  <td>
467
481
  <pre class="code"><span class="info file"># File 'lib/axlsx/stylesheet/border.rb', line 9</span>
468
482
 
469
- <span class='kw'>def</span> <span class='id diagonalDown'>diagonalDown</span>
470
- <span class='ivar'>@diagonalDown</span>
471
- <span class='kw'>end</span></pre>
483
+ <span class='def def kw'>def</span> <span class='diagonalDown identifier id'>diagonalDown</span>
484
+ <span class='@diagonalDown ivar id'>@diagonalDown</span>
485
+ <span class='end end kw'>end</span>
486
+ </pre>
472
487
  </td>
473
488
  </tr>
474
489
  </table>
@@ -486,9 +501,10 @@ cell.</p>
486
501
 
487
502
  </p><div class="docstring">
488
503
  <div class="discussion">
489
-
490
- <p>The diagonal up property for the border that indicates if the border should
491
- include a diagonal line from the bottom left to the top right of the cell.</p>
504
+ <p>
505
+ The diagonal up property for the border that indicates if the border should
506
+ include a diagonal line from the bottom left to the top right of the cell.
507
+ </p>
492
508
 
493
509
 
494
510
  </div>
@@ -506,9 +522,10 @@ include a diagonal line from the bottom left to the top right of the cell.</p>
506
522
 
507
523
 
508
524
  &mdash;
509
- <div class='inline'>
510
- <p>The diagonal up property for the border that indicates if the border should
511
- include a diagonal line from the bottom left to the top right of the cell.</p>
525
+ <div class='inline'><p>
526
+ The diagonal up property for the border that indicates if the border should
527
+ include a diagonal line from the bottom left to the top right of the cell.
528
+ </p>
512
529
  </div>
513
530
 
514
531
  </li>
@@ -528,9 +545,10 @@ include a diagonal line from the bottom left to the top right of the cell.</p>
528
545
  <td>
529
546
  <pre class="code"><span class="info file"># File 'lib/axlsx/stylesheet/border.rb', line 6</span>
530
547
 
531
- <span class='kw'>def</span> <span class='id diagonalUp'>diagonalUp</span>
532
- <span class='ivar'>@diagonalUp</span>
533
- <span class='kw'>end</span></pre>
548
+ <span class='def def kw'>def</span> <span class='diagonalUp identifier id'>diagonalUp</span>
549
+ <span class='@diagonalUp ivar id'>@diagonalUp</span>
550
+ <span class='end end kw'>end</span>
551
+ </pre>
534
552
  </td>
535
553
  </tr>
536
554
  </table>
@@ -548,10 +566,11 @@ include a diagonal line from the bottom left to the top right of the cell.</p>
548
566
 
549
567
  </p><div class="docstring">
550
568
  <div class="discussion">
551
-
552
- <p>The outline property for the border indicating that top, left, right and
569
+ <p>
570
+ The outline property for the border indicating that top, left, right and
553
571
  bottom borders should only be applied to the outside border of a range of
554
- cells.</p>
572
+ cells.
573
+ </p>
555
574
 
556
575
 
557
576
  </div>
@@ -569,10 +588,11 @@ cells.</p>
569
588
 
570
589
 
571
590
  &mdash;
572
- <div class='inline'>
573
- <p>The outline property for the border indicating that top, left, right and
591
+ <div class='inline'><p>
592
+ The outline property for the border indicating that top, left, right and
574
593
  bottom borders should only be applied to the outside border of a range of
575
- cells.</p>
594
+ cells.
595
+ </p>
576
596
  </div>
577
597
 
578
598
  </li>
@@ -592,9 +612,10 @@ cells.</p>
592
612
  <td>
593
613
  <pre class="code"><span class="info file"># File 'lib/axlsx/stylesheet/border.rb', line 12</span>
594
614
 
595
- <span class='kw'>def</span> <span class='id outline'>outline</span>
596
- <span class='ivar'>@outline</span>
597
- <span class='kw'>end</span></pre>
615
+ <span class='def def kw'>def</span> <span class='outline identifier id'>outline</span>
616
+ <span class='@outline ivar id'>@outline</span>
617
+ <span class='end end kw'>end</span>
618
+ </pre>
598
619
  </td>
599
620
  </tr>
600
621
  </table>
@@ -612,8 +633,9 @@ cells.</p>
612
633
 
613
634
  </p><div class="docstring">
614
635
  <div class="discussion">
615
-
616
- <p>A list of BorderPr objects for this border.</p>
636
+ <p>
637
+ A list of BorderPr objects for this border.
638
+ </p>
617
639
 
618
640
 
619
641
  </div>
@@ -631,8 +653,9 @@ cells.</p>
631
653
 
632
654
 
633
655
  &mdash;
634
- <div class='inline'>
635
- <p>A list of BorderPr objects for this border.</p>
656
+ <div class='inline'><p>
657
+ A list of BorderPr objects for this border.
658
+ </p>
636
659
  </div>
637
660
 
638
661
  </li>
@@ -652,9 +675,10 @@ cells.</p>
652
675
  <td>
653
676
  <pre class="code"><span class="info file"># File 'lib/axlsx/stylesheet/border.rb', line 15</span>
654
677
 
655
- <span class='kw'>def</span> <span class='id prs'>prs</span>
656
- <span class='ivar'>@prs</span>
657
- <span class='kw'>end</span></pre>
678
+ <span class='def def kw'>def</span> <span class='prs identifier id'>prs</span>
679
+ <span class='@prs ivar id'>@prs</span>
680
+ <span class='end end kw'>end</span>
681
+ </pre>
658
682
  </td>
659
683
  </tr>
660
684
  </table>
@@ -676,8 +700,9 @@ cells.</p>
676
700
 
677
701
  </p><div class="docstring">
678
702
  <div class="discussion">
679
-
680
- <p>Serializes the border element</p>
703
+ <p>
704
+ Serializes the border element
705
+ </p>
681
706
 
682
707
 
683
708
  </div>
@@ -696,8 +721,9 @@ cells.</p>
696
721
 
697
722
 
698
723
  &mdash;
699
- <div class='inline'>
700
- <p>The document builder instance this objects xml will be added to.</p>
724
+ <div class='inline'><p>
725
+ The document builder instance this objects xml will be added to.
726
+ </p>
701
727
  </div>
702
728
 
703
729
  </li>
@@ -724,15 +750,16 @@ cells.</p>
724
750
  <td>
725
751
  <pre class="code"><span class="info file"># File 'lib/axlsx/stylesheet/border.rb', line 47</span>
726
752
 
727
- <span class='kw'>def</span> <span class='id to_xml'>to_xml</span><span class='lparen'>(</span><span class='id xml'>xml</span><span class='rparen'>)</span>
728
- <span class='id xml'>xml</span><span class='period'>.</span><span class='id border'>border</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id instance_values'>instance_values</span><span class='period'>.</span><span class='id select'>select</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id k'>k</span><span class='comma'>,</span><span class='id v'>v</span><span class='op'>|</span> <span class='lbracket'>[</span><span class='symbol'>:diagonalUp</span><span class='comma'>,</span> <span class='symbol'>:diagonalDown</span><span class='comma'>,</span> <span class='symbol'>:outline</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id include?'>include?</span> <span class='id k'>k</span> <span class='rbrace'>}</span><span class='rparen'>)</span> <span class='lbrace'>{</span>
729
- <span class='lbracket'>[</span><span class='symbol'>:start</span><span class='comma'>,</span> <span class='symbol'>:end</span><span class='comma'>,</span> <span class='symbol'>:left</span><span class='comma'>,</span> <span class='symbol'>:right</span><span class='comma'>,</span> <span class='symbol'>:top</span><span class='comma'>,</span> <span class='symbol'>:bottom</span><span class='comma'>,</span> <span class='symbol'>:diagonal</span><span class='comma'>,</span> <span class='symbol'>:vertical</span><span class='comma'>,</span> <span class='symbol'>:horizontal</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id k'>k</span><span class='op'>|</span>
730
- <span class='ivar'>@prs</span><span class='period'>.</span><span class='id select'>select</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id pr'>pr</span><span class='op'>|</span> <span class='id pr'>pr</span><span class='period'>.</span><span class='id name'>name</span> <span class='op'>==</span> <span class='id k'>k</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id part'>part</span><span class='op'>|</span>
731
- <span class='id part'>part</span><span class='period'>.</span><span class='id to_xml'>to_xml</span><span class='lparen'>(</span><span class='id xml'>xml</span><span class='rparen'>)</span>
732
- <span class='kw'>end</span>
733
- <span class='kw'>end</span>
734
- <span class='rbrace'>}</span>
735
- <span class='kw'>end</span></pre>
753
+ <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>
754
+ <span class='xml identifier id'>xml</span><span class='dot token'>.</span><span class='border identifier id'>border</span><span class='lparen token'>(</span><span class='self self kw'>self</span><span class='dot token'>.</span><span class='instance_values identifier id'>instance_values</span><span class='dot token'>.</span><span class='select identifier id'>select</span><span class='lbrace token'>{</span> <span class='bitor op'>|</span><span class='k identifier id'>k</span><span class='comma token'>,</span><span class='v identifier id'>v</span><span class='bitor op'>|</span> <span class='lbrack token'>[</span><span class='symbol val'>:diagonalUp</span><span class='comma token'>,</span> <span class='symbol val'>:diagonalDown</span><span class='comma token'>,</span> <span class='symbol val'>:outline</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='include? fid id'>include?</span> <span class='k identifier id'>k</span> <span class='rbrace token'>}</span><span class='rparen token'>)</span> <span class='lbrace token'>{</span>
755
+ <span class='lbrack token'>[</span><span class='symbol val'>:start</span><span class='comma token'>,</span> <span class='symbol val'>:end</span><span class='comma token'>,</span> <span class='symbol val'>:left</span><span class='comma token'>,</span> <span class='symbol val'>:right</span><span class='comma token'>,</span> <span class='symbol val'>:top</span><span class='comma token'>,</span> <span class='symbol val'>:bottom</span><span class='comma token'>,</span> <span class='symbol val'>:diagonal</span><span class='comma token'>,</span> <span class='symbol val'>:vertical</span><span class='comma token'>,</span> <span class='symbol val'>:horizontal</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='k identifier id'>k</span><span class='bitor op'>|</span>
756
+ <span class='@prs ivar id'>@prs</span><span class='dot token'>.</span><span class='select identifier id'>select</span> <span class='lbrace token'>{</span> <span class='bitor op'>|</span><span class='pr identifier id'>pr</span><span class='bitor op'>|</span> <span class='pr identifier id'>pr</span><span class='dot token'>.</span><span class='name identifier id'>name</span> <span class='eq op'>==</span> <span class='k identifier id'>k</span> <span class='rbrace token'>}</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='part identifier id'>part</span><span class='bitor op'>|</span>
757
+ <span class='part identifier id'>part</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>
758
+ <span class='end end kw'>end</span>
759
+ <span class='end end kw'>end</span>
760
+ <span class='rbrace token'>}</span>
761
+ <span class='end end kw'>end</span>
762
+ </pre>
736
763
  </td>
737
764
  </tr>
738
765
  </table>
@@ -743,9 +770,9 @@ cells.</p>
743
770
  </div>
744
771
 
745
772
  <div id="footer">
746
- Generated on Sat Nov 26 13:16:37 2011 by
773
+ Generated on Sun Nov 27 21:54:23 2011 by
747
774
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
748
- 0.7.3 (ruby-1.9.3).
775
+ 0.7.3 (ruby-1.8.7).
749
776
  </div>
750
777
 
751
778
  </body>