axlsx 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Axlsx::SeriesTitle
8
8
 
9
- &mdash; Documentation by YARD 0.7.3
9
+ &mdash; AXLSX
10
10
 
11
11
  </title>
12
12
 
@@ -96,10 +96,9 @@
96
96
 
97
97
  <h2>Overview</h2><div class="docstring">
98
98
  <div class="discussion">
99
- <p>
100
- A series title is a Title with a slightly different serialization than
101
- chart titles.
102
- </p>
99
+
100
+ <p>A series title is a Title with a slightly different serialization than
101
+ chart titles.</p>
103
102
 
104
103
 
105
104
  </div>
@@ -148,9 +147,8 @@ chart titles.
148
147
 
149
148
 
150
149
 
151
- <span class="summary_desc"><div class='inline'><p>
152
- Serializes the series title.
153
- </p>
150
+ <span class="summary_desc"><div class='inline'>
151
+ <p>Serializes the series title.</p>
154
152
  </div></span>
155
153
 
156
154
  </li>
@@ -168,7 +166,7 @@ Serializes the series title.
168
166
 
169
167
 
170
168
  <h3 class="inherited">Methods inherited from <span class='object_link'><a href="Title.html" title="Axlsx::Title (class)">Title</a></span></h3>
171
- <p class="inherited"><span class='object_link'><a href="Title.html#initialize-instance_method" title="Axlsx::Title#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="Title.html#range-instance_method" title="Axlsx::Title#range (method)">#range</a></span></p>
169
+ <p class="inherited"><span class='object_link'><a href="Title.html#initialize-instance_method" title="Axlsx::Title#initialize (method)">#initialize</a></span></p>
172
170
  <div id="constructor_details" class="method_details_list">
173
171
  <h2>Constructor Details</h2>
174
172
 
@@ -190,9 +188,8 @@ Serializes the series title.
190
188
 
191
189
  </p><div class="docstring">
192
190
  <div class="discussion">
193
- <p>
194
- Serializes the series title
195
- </p>
191
+
192
+ <p>Serializes the series title</p>
196
193
 
197
194
 
198
195
  </div>
@@ -211,9 +208,8 @@ Serializes the series title
211
208
 
212
209
 
213
210
  &mdash;
214
- <div class='inline'><p>
215
- The document builder instance this objects xml will be added to.
216
- </p>
211
+ <div class='inline'>
212
+ <p>The document builder instance this objects xml will be added to.</p>
217
213
  </div>
218
214
 
219
215
  </li>
@@ -257,20 +253,19 @@ The document builder instance this objects xml will be added to.
257
253
  <td>
258
254
  <pre class="code"><span class="info file"># File 'lib/axlsx/drawing/series_title.rb', line 8</span>
259
255
 
260
- <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>
261
- <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='string val'>'c:tx'</span><span class='rparen token'>)</span> <span class='lbrace token'>{</span>
262
- <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='string val'>'c:strRef'</span><span class='rparen token'>)</span> <span class='lbrace token'>{</span>
263
- <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='string val'>'c:f'</span><span class='comma token'>,</span> <span class='range identifier id'>range</span><span class='rparen token'>)</span>
264
- <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='string val'>'c:strCache'</span><span class='rparen token'>)</span> <span class='lbrace token'>{</span>
265
- <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='string val'>'c:ptCount'</span><span class='comma token'>,</span> <span class='symbol val'>:val=</span><span class='gt op'>&gt;</span><span class='integer val'>1</span><span class='rparen token'>)</span>
266
- <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='string val'>'c:pt'</span><span class='comma token'>,</span> <span class='symbol val'>:idx=</span><span class='gt op'>&gt;</span><span class='integer val'>0</span><span class='rparen token'>)</span> <span class='lbrace token'>{</span>
267
- <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='string val'>'c:v'</span><span class='comma token'>,</span> <span class='@text ivar id'>@text</span><span class='rparen token'>)</span>
268
- <span class='rbrace token'>}</span>
269
- <span class='rbrace token'>}</span>
270
- <span class='rbrace token'>}</span>
271
- <span class='rbrace token'>}</span>
272
- <span class='end end kw'>end</span>
273
- </pre>
256
+ <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>
257
+ <span class='id xml'>xml</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:tx</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span>
258
+ <span class='id xml'>xml</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:strRef</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span>
259
+ <span class='id xml'>xml</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:f</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='id cell_range'>cell_range</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='ivar'>@cell</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='rparen'>)</span>
260
+ <span class='id xml'>xml</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:strCache</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='lbrace'>{</span>
261
+ <span class='id xml'>xml</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:ptCount</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:val</span><span class='op'>=&gt;</span><span class='int'>1</span><span class='rparen'>)</span>
262
+ <span class='id xml'>xml</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:pt</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='symbol'>:idx</span><span class='op'>=&gt;</span><span class='int'>0</span><span class='rparen'>)</span> <span class='lbrace'>{</span>
263
+ <span class='id xml'>xml</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:v</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='ivar'>@text</span><span class='rparen'>)</span>
264
+ <span class='rbrace'>}</span>
265
+ <span class='rbrace'>}</span>
266
+ <span class='rbrace'>}</span>
267
+ <span class='rbrace'>}</span>
268
+ <span class='kw'>end</span></pre>
274
269
  </td>
275
270
  </tr>
276
271
  </table>
@@ -281,9 +276,9 @@ The document builder instance this objects xml will be added to.
281
276
  </div>
282
277
 
283
278
  <div id="footer">
284
- Generated on Wed Nov 23 21:47:55 2011 by
279
+ Generated on Sat Nov 26 13:16:38 2011 by
285
280
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
286
- 0.7.3 (ruby-1.8.7).
281
+ 0.7.3 (ruby-1.9.3).
287
282
  </div>
288
283
 
289
284
  </body>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Axlsx::Styles
8
8
 
9
- &mdash; Documentation by YARD 0.7.3
9
+ &mdash; AXLSX
10
10
 
11
11
  </title>
12
12
 
@@ -97,20 +97,18 @@
97
97
 
98
98
  <div class="note notetag">
99
99
  <strong>Note:</strong>
100
- <div class='inline'><p>
101
- The recommended way to manage styles is with add_style
102
- </p>
100
+ <div class='inline'>
101
+ <p>The recommended way to manage styles is with add_style</p>
103
102
  </div>
104
103
  </div>
105
104
 
106
- <p>
107
- The Styles class manages worksheet styles In addition to creating the
105
+
106
+ <p>The Styles class manages worksheet styles In addition to creating the
108
107
  require style objects for a valid xlsx package, this class provides the key
109
108
  mechanism for adding styles to your workbook, and safely applying them to
110
109
  the cells of your worksheet. All portions of the stylesheet are implemented
111
110
  here exception colors, which specify legacy and modified pallete colors,
112
- and exLst, whic is used as a future feature data storage area.
113
- </p>
111
+ and exLst, whic is used as a future feature data storage area.</p>
114
112
 
115
113
 
116
114
  </div>
@@ -151,10 +149,9 @@ and exLst, whic is used as a future feature data storage area.
151
149
 
152
150
 
153
151
 
154
- <span class="summary_desc"><div class='inline'><p>
155
- The collection of borders used in this workbook Axlsx predefines
156
- THIN_BORDER which can be used to put a border around all of your cells.
157
- </p>
152
+ <span class="summary_desc"><div class='inline'>
153
+ <p>The collection of borders used in this workbook Axlsx predefines
154
+ THIN_BORDER which can be used to put a border around all of your cells.</p>
158
155
  </div></span>
159
156
 
160
157
  </li>
@@ -179,10 +176,9 @@ THIN_BORDER which can be used to put a border around all of your cells.
179
176
 
180
177
 
181
178
 
182
- <span class="summary_desc"><div class='inline'><p>
183
- The collection of named styles, referencing cellStyleXfs items in the
184
- workbook.
185
- </p>
179
+ <span class="summary_desc"><div class='inline'>
180
+ <p>The collection of named styles, referencing cellStyleXfs items in the
181
+ workbook.</p>
186
182
  </div></span>
187
183
 
188
184
  </li>
@@ -207,10 +203,9 @@ workbook.
207
203
 
208
204
 
209
205
 
210
- <span class="summary_desc"><div class='inline'><p>
211
- The collection of master formatting records for named cell styles, which
212
- means records defined in cellStyles, in the workbook.
213
- </p>
206
+ <span class="summary_desc"><div class='inline'>
207
+ <p>The collection of master formatting records for named cell styles, which
208
+ means records defined in cellStyles, in the workbook.</p>
214
209
  </div></span>
215
210
 
216
211
  </li>
@@ -235,9 +230,8 @@ means records defined in cellStyles, in the workbook.
235
230
 
236
231
 
237
232
 
238
- <span class="summary_desc"><div class='inline'><p>
239
- The collection of master formatting records.
240
- </p>
233
+ <span class="summary_desc"><div class='inline'>
234
+ <p>The collection of master formatting records.</p>
241
235
  </div></span>
242
236
 
243
237
  </li>
@@ -262,9 +256,8 @@ The collection of master formatting records.
262
256
 
263
257
 
264
258
 
265
- <span class="summary_desc"><div class='inline'><p>
266
- The collection of non-cell formatting records used in the worksheet.
267
- </p>
259
+ <span class="summary_desc"><div class='inline'>
260
+ <p>The collection of non-cell formatting records used in the worksheet.</p>
268
261
  </div></span>
269
262
 
270
263
  </li>
@@ -289,9 +282,8 @@ The collection of non-cell formatting records used in the worksheet.
289
282
 
290
283
 
291
284
 
292
- <span class="summary_desc"><div class='inline'><p>
293
- The collection of fills used in this workbook.
294
- </p>
285
+ <span class="summary_desc"><div class='inline'>
286
+ <p>The collection of fills used in this workbook.</p>
295
287
  </div></span>
296
288
 
297
289
  </li>
@@ -316,9 +308,8 @@ The collection of fills used in this workbook.
316
308
 
317
309
 
318
310
 
319
- <span class="summary_desc"><div class='inline'><p>
320
- The collection of fonts used in this workbook.
321
- </p>
311
+ <span class="summary_desc"><div class='inline'>
312
+ <p>The collection of fonts used in this workbook.</p>
322
313
  </div></span>
323
314
 
324
315
  </li>
@@ -343,9 +334,8 @@ The collection of fonts used in this workbook.
343
334
 
344
335
 
345
336
 
346
- <span class="summary_desc"><div class='inline'><p>
347
- numFmts for your styles.
348
- </p>
337
+ <span class="summary_desc"><div class='inline'>
338
+ <p>numFmts for your styles.</p>
349
339
  </div></span>
350
340
 
351
341
  </li>
@@ -370,10 +360,9 @@ numFmts for your styles.
370
360
 
371
361
 
372
362
 
373
- <span class="summary_desc"><div class='inline'><p>
374
- The collection of table styles that will be available to the user in the
375
- excel UI.
376
- </p>
363
+ <span class="summary_desc"><div class='inline'>
364
+ <p>The collection of table styles that will be available to the user in the
365
+ excel UI.</p>
377
366
  </div></span>
378
367
 
379
368
  </li>
@@ -408,9 +397,8 @@ excel UI.
408
397
 
409
398
 
410
399
 
411
- <span class="summary_desc"><div class='inline'><p>
412
- Drastically simplifies style creation and management.
413
- </p>
400
+ <span class="summary_desc"><div class='inline'>
401
+ <p>Drastically simplifies style creation and management.</p>
414
402
  </div></span>
415
403
 
416
404
  </li>
@@ -434,10 +422,9 @@ Drastically simplifies style creation and management.
434
422
 
435
423
 
436
424
 
437
- <span class="summary_desc"><div class='inline'><p>
438
- Creates a new Styles object and prepopulates it with the requires objects
439
- to generate a valid package style part.
440
- </p>
425
+ <span class="summary_desc"><div class='inline'>
426
+ <p>Creates a new Styles object and prepopulates it with the requires objects
427
+ to generate a valid package style part.</p>
441
428
  </div></span>
442
429
 
443
430
  </li>
@@ -459,9 +446,8 @@ to generate a valid package style part.
459
446
 
460
447
 
461
448
 
462
- <span class="summary_desc"><div class='inline'><p>
463
- Serializes the styles document.
464
- </p>
449
+ <span class="summary_desc"><div class='inline'>
450
+ <p>Serializes the styles document.</p>
465
451
  </div></span>
466
452
 
467
453
  </li>
@@ -482,10 +468,9 @@ Serializes the styles document.
482
468
 
483
469
  </p><div class="docstring">
484
470
  <div class="discussion">
485
- <p>
486
- Creates a new Styles object and prepopulates it with the requires objects
487
- to generate a valid package style part.
488
- </p>
471
+
472
+ <p>Creates a new Styles object and prepopulates it with the requires objects
473
+ to generate a valid package style part.</p>
489
474
 
490
475
 
491
476
  </div>
@@ -506,10 +491,9 @@ to generate a valid package style part.
506
491
  <td>
507
492
  <pre class="code"><span class="info file"># File 'lib/axlsx/stylesheet/styles.rb', line 118</span>
508
493
 
509
- <span class='def def kw'>def</span> <span class='initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='rparen token'>)</span>
510
- <span class='load_default_styles identifier id'>load_default_styles</span>
511
- <span class='end end kw'>end</span>
512
- </pre>
494
+ <span class='kw'>def</span> <span class='id initialize'>initialize</span><span class='lparen'>(</span><span class='rparen'>)</span>
495
+ <span class='id load_default_styles'>load_default_styles</span>
496
+ <span class='kw'>end</span></pre>
513
497
  </td>
514
498
  </tr>
515
499
  </table>
@@ -535,16 +519,14 @@ to generate a valid package style part.
535
519
 
536
520
  <div class="note notetag">
537
521
  <strong>Note:</strong>
538
- <div class='inline'><p>
539
- The recommended way to manage styles is with add_style
540
- </p>
522
+ <div class='inline'>
523
+ <p>The recommended way to manage styles is with add_style</p>
541
524
  </div>
542
525
  </div>
543
526
 
544
- <p>
545
- The collection of borders used in this workbook Axlsx predefines
546
- THIN_BORDER which can be used to put a border around all of your cells.
547
- </p>
527
+
528
+ <p>The collection of borders used in this workbook Axlsx predefines
529
+ THIN_BORDER which can be used to put a border around all of your cells.</p>
548
530
 
549
531
 
550
532
  </div>
@@ -585,10 +567,9 @@ THIN_BORDER which can be used to put a border around all of your cells.
585
567
  <td>
586
568
  <pre class="code"><span class="info file"># File 'lib/axlsx/stylesheet/styles.rb', line 85</span>
587
569
 
588
- <span class='def def kw'>def</span> <span class='borders identifier id'>borders</span>
589
- <span class='@borders ivar id'>@borders</span>
590
- <span class='end end kw'>end</span>
591
- </pre>
570
+ <span class='kw'>def</span> <span class='id borders'>borders</span>
571
+ <span class='ivar'>@borders</span>
572
+ <span class='kw'>end</span></pre>
592
573
  </td>
593
574
  </tr>
594
575
  </table>
@@ -609,16 +590,14 @@ THIN_BORDER which can be used to put a border around all of your cells.
609
590
 
610
591
  <div class="note notetag">
611
592
  <strong>Note:</strong>
612
- <div class='inline'><p>
613
- The recommended way to manage styles is with add_style
614
- </p>
593
+ <div class='inline'>
594
+ <p>The recommended way to manage styles is with add_style</p>
615
595
  </div>
616
596
  </div>
617
597
 
618
- <p>
619
- The collection of named styles, referencing cellStyleXfs items in the
620
- workbook.
621
- </p>
598
+
599
+ <p>The collection of named styles, referencing cellStyleXfs items in the
600
+ workbook.</p>
622
601
 
623
602
 
624
603
  </div>
@@ -659,10 +638,9 @@ workbook.
659
638
  <td>
660
639
  <pre class="code"><span class="info file"># File 'lib/axlsx/stylesheet/styles.rb', line 97</span>
661
640
 
662
- <span class='def def kw'>def</span> <span class='cellStyles identifier id'>cellStyles</span>
663
- <span class='@cellStyles ivar id'>@cellStyles</span>
664
- <span class='end end kw'>end</span>
665
- </pre>
641
+ <span class='kw'>def</span> <span class='id cellStyles'>cellStyles</span>
642
+ <span class='ivar'>@cellStyles</span>
643
+ <span class='kw'>end</span></pre>
666
644
  </td>
667
645
  </tr>
668
646
  </table>
@@ -683,16 +661,14 @@ workbook.
683
661
 
684
662
  <div class="note notetag">
685
663
  <strong>Note:</strong>
686
- <div class='inline'><p>
687
- The recommended way to manage styles is with add_style
688
- </p>
664
+ <div class='inline'>
665
+ <p>The recommended way to manage styles is with add_style</p>
689
666
  </div>
690
667
  </div>
691
668
 
692
- <p>
693
- The collection of master formatting records for named cell styles, which
694
- means records defined in cellStyles, in the workbook
695
- </p>
669
+
670
+ <p>The collection of master formatting records for named cell styles, which
671
+ means records defined in cellStyles, in the workbook</p>
696
672
 
697
673
 
698
674
  </div>
@@ -733,10 +709,9 @@ means records defined in cellStyles, in the workbook
733
709
  <td>
734
710
  <pre class="code"><span class="info file"># File 'lib/axlsx/stylesheet/styles.rb', line 91</span>
735
711
 
736
- <span class='def def kw'>def</span> <span class='cellStyleXfs identifier id'>cellStyleXfs</span>
737
- <span class='@cellStyleXfs ivar id'>@cellStyleXfs</span>
738
- <span class='end end kw'>end</span>
739
- </pre>
712
+ <span class='kw'>def</span> <span class='id cellStyleXfs'>cellStyleXfs</span>
713
+ <span class='ivar'>@cellStyleXfs</span>
714
+ <span class='kw'>end</span></pre>
740
715
  </td>
741
716
  </tr>
742
717
  </table>
@@ -757,16 +732,14 @@ means records defined in cellStyles, in the workbook
757
732
 
758
733
  <div class="note notetag">
759
734
  <strong>Note:</strong>
760
- <div class='inline'><p>
761
- The recommended way to manage styles is with add_style
762
- </p>
735
+ <div class='inline'>
736
+ <p>The recommended way to manage styles is with add_style</p>
763
737
  </div>
764
738
  </div>
765
739
 
766
- <p>
767
- The collection of master formatting records. This is the list that you will
768
- actually use in styling a workbook.
769
- </p>
740
+
741
+ <p>The collection of master formatting records. This is the list that you will
742
+ actually use in styling a workbook.</p>
770
743
 
771
744
 
772
745
  </div>
@@ -807,10 +780,9 @@ actually use in styling a workbook.
807
780
  <td>
808
781
  <pre class="code"><span class="info file"># File 'lib/axlsx/stylesheet/styles.rb', line 103</span>
809
782
 
810
- <span class='def def kw'>def</span> <span class='cellXfs identifier id'>cellXfs</span>
811
- <span class='@cellXfs ivar id'>@cellXfs</span>
812
- <span class='end end kw'>end</span>
813
- </pre>
783
+ <span class='kw'>def</span> <span class='id cellXfs'>cellXfs</span>
784
+ <span class='ivar'>@cellXfs</span>
785
+ <span class='kw'>end</span></pre>
814
786
  </td>
815
787
  </tr>
816
788
  </table>
@@ -831,15 +803,13 @@ actually use in styling a workbook.
831
803
 
832
804
  <div class="note notetag">
833
805
  <strong>Note:</strong>
834
- <div class='inline'><p>
835
- The recommended way to manage styles is with add_style
836
- </p>
806
+ <div class='inline'>
807
+ <p>The recommended way to manage styles is with add_style</p>
837
808
  </div>
838
809
  </div>
839
810
 
840
- <p>
841
- The collection of non-cell formatting records used in the worksheet.
842
- </p>
811
+
812
+ <p>The collection of non-cell formatting records used in the worksheet.</p>
843
813
 
844
814
 
845
815
  </div>
@@ -880,10 +850,9 @@ The collection of non-cell formatting records used in the worksheet.
880
850
  <td>
881
851
  <pre class="code"><span class="info file"># File 'lib/axlsx/stylesheet/styles.rb', line 109</span>
882
852
 
883
- <span class='def def kw'>def</span> <span class='dxfs identifier id'>dxfs</span>
884
- <span class='@dxfs ivar id'>@dxfs</span>
885
- <span class='end end kw'>end</span>
886
- </pre>
853
+ <span class='kw'>def</span> <span class='id dxfs'>dxfs</span>
854
+ <span class='ivar'>@dxfs</span>
855
+ <span class='kw'>end</span></pre>
887
856
  </td>
888
857
  </tr>
889
858
  </table>
@@ -904,15 +873,13 @@ The collection of non-cell formatting records used in the worksheet.
904
873
 
905
874
  <div class="note notetag">
906
875
  <strong>Note:</strong>
907
- <div class='inline'><p>
908
- The recommended way to manage styles is with add_style
909
- </p>
876
+ <div class='inline'>
877
+ <p>The recommended way to manage styles is with add_style</p>
910
878
  </div>
911
879
  </div>
912
880
 
913
- <p>
914
- The collection of fills used in this workbook
915
- </p>
881
+
882
+ <p>The collection of fills used in this workbook</p>
916
883
 
917
884
 
918
885
  </div>
@@ -953,10 +920,9 @@ The collection of fills used in this workbook
953
920
  <td>
954
921
  <pre class="code"><span class="info file"># File 'lib/axlsx/stylesheet/styles.rb', line 78</span>
955
922
 
956
- <span class='def def kw'>def</span> <span class='fills identifier id'>fills</span>
957
- <span class='@fills ivar id'>@fills</span>
958
- <span class='end end kw'>end</span>
959
- </pre>
923
+ <span class='kw'>def</span> <span class='id fills'>fills</span>
924
+ <span class='ivar'>@fills</span>
925
+ <span class='kw'>end</span></pre>
960
926
  </td>
961
927
  </tr>
962
928
  </table>
@@ -977,15 +943,13 @@ The collection of fills used in this workbook
977
943
 
978
944
  <div class="note notetag">
979
945
  <strong>Note:</strong>
980
- <div class='inline'><p>
981
- The recommended way to manage styles is with add_style
982
- </p>
946
+ <div class='inline'>
947
+ <p>The recommended way to manage styles is with add_style</p>
983
948
  </div>
984
949
  </div>
985
950
 
986
- <p>
987
- The collection of fonts used in this workbook
988
- </p>
951
+
952
+ <p>The collection of fonts used in this workbook</p>
989
953
 
990
954
 
991
955
  </div>
@@ -1026,10 +990,9 @@ The collection of fonts used in this workbook
1026
990
  <td>
1027
991
  <pre class="code"><span class="info file"># File 'lib/axlsx/stylesheet/styles.rb', line 72</span>
1028
992
 
1029
- <span class='def def kw'>def</span> <span class='fonts identifier id'>fonts</span>
1030
- <span class='@fonts ivar id'>@fonts</span>
1031
- <span class='end end kw'>end</span>
1032
- </pre>
993
+ <span class='kw'>def</span> <span class='id fonts'>fonts</span>
994
+ <span class='ivar'>@fonts</span>
995
+ <span class='kw'>end</span></pre>
1033
996
  </td>
1034
997
  </tr>
1035
998
  </table>
@@ -1050,51 +1013,48 @@ The collection of fonts used in this workbook
1050
1013
 
1051
1014
  <div class="note notetag">
1052
1015
  <strong>Note:</strong>
1053
- <div class='inline'><p>
1054
- The recommended way to manage styles is with add_style
1055
- </p>
1016
+ <div class='inline'>
1017
+ <p>The recommended way to manage styles is with add_style</p>
1056
1018
  </div>
1057
1019
  </div>
1058
1020
 
1059
- <p>
1060
- numFmts for your styles.
1061
- </p>
1062
- <pre class="code">
1063
- <span class='The constant id'>The</span> <span class='default identifier id'>default</span> <span class='styles identifier id'>styles</span><span class='comma token'>,</span> <span class='which identifier id'>which</span> <span class='change identifier id'>change</span> <span class='based identifier id'>based</span> <span class='on identifier id'>on</span> <span class='the identifier id'>the</span> <span class='system identifier id'>system</span> <span class='local identifier id'>local</span><span class='comma token'>,</span> <span class='are identifier id'>are</span> <span class='as identifier id'>as</span> <span class='follows identifier id'>follows</span><span class='dot token'>.</span>
1064
- <span class='id identifier id'>id</span> <span class='formatCode identifier id'>formatCode</span>
1065
- <span class='integer val'>0</span> <span class='General constant id'>General</span>
1066
- <span class='integer val'>1</span> <span class='integer val'>0</span>
1067
- <span class='integer val'>2</span> <span class='integer val'>0</span><span class='integer val'>.00</span>
1068
- <span class='integer val'>3</span> <span class='comment val'>#,##0</span>
1069
- <span class='integer val'>4</span> <span class='comment val'>#,##0.00</span>
1070
- <span class='integer val'>9</span> <span class='integer val'>0</span><span class='mod op'>%</span>
1071
- <span class='integer val'>10</span> <span class='integer val'>0</span><span class='integer val'>.00</span><span class='mod op'>%</span>
1072
- <span class='integer val'>11</span> <span class='integer val'>0</span><span class='float val'>.00E+00</span>
1073
- <span class='integer val'>12</span> <span class='comment val'># ?/?</span>
1074
- <span class='integer val'>13</span> <span class='comment val'># ??/??</span>
1075
- <span class='integer val'>14</span> <span class='mm identifier id'>mm</span><span class='minus op'>-</span><span class='dd identifier id'>dd</span><span class='minus op'>-</span><span class='yy identifier id'>yy</span>
1076
- <span class='integer val'>15</span> <span class='d identifier id'>d</span><span class='minus op'>-</span><span class='mmm identifier id'>mmm</span><span class='minus op'>-</span><span class='yy identifier id'>yy</span>
1077
- <span class='integer val'>16</span> <span class='d identifier id'>d</span><span class='minus op'>-</span><span class='mmm identifier id'>mmm</span>
1078
- <span class='integer val'>17</span> <span class='mmm identifier id'>mmm</span><span class='minus op'>-</span><span class='yy identifier id'>yy</span>
1079
- <span class='integer val'>18</span> <span class='h identifier id'>h</span><span class='symbol val'>:mm</span> <span class='AM constant id'>AM</span><span class='div op'>/</span><span class='PM constant id'>PM</span>
1080
- <span class='integer val'>19</span> <span class='h identifier id'>h</span><span class='symbol val'>:mm</span><span class='symbol val'>:ss</span> <span class='AM constant id'>AM</span><span class='div op'>/</span><span class='PM constant id'>PM</span>
1081
- <span class='integer val'>20</span> <span class='h identifier id'>h</span><span class='symbol val'>:mm</span>
1082
- <span class='integer val'>21</span> <span class='h identifier id'>h</span><span class='symbol val'>:mm</span><span class='symbol val'>:ss</span>
1083
- <span class='integer val'>22</span> <span class='m identifier id'>m</span><span class='div op'>/</span><span class='d identifier id'>d</span><span class='div op'>/</span><span class='yy identifier id'>yy</span> <span class='h identifier id'>h</span><span class='symbol val'>:mm</span>
1084
- <span class='integer val'>37</span> <span class='comment val'>#,##0 ;(#,##0)</span>
1085
- <span class='integer val'>38</span> <span class='comment val'>#,##0 ;[Red](#,##0)</span>
1086
- <span class='integer val'>39</span> <span class='comment val'>#,##0.00;(#,##0.00)</span>
1087
- <span class='integer val'>40</span> <span class='comment val'>#,##0.00;[Red](#,##0.00)</span>
1088
- <span class='integer val'>45</span> <span class='mm identifier id'>mm</span><span class='symbol val'>:ss</span>
1089
- <span class='integer val'>46</span> <span class='lbrack token'>[</span><span class='h identifier id'>h</span><span class='rbrack token'>]</span><span class='symbol val'>:mm</span><span class='symbol val'>:ss</span>
1090
- <span class='integer val'>47</span> <span class='mmss identifier id'>mmss</span><span class='integer val'>.0</span>
1091
- <span class='integer val'>48</span> <span class='comment val'>##0.0E+0</span>
1092
- <span class='integer val'>49</span> @
1093
- <span class='Axlsx constant id'>Axlsx</span> <span class='also identifier id'>also</span> <span class='defines identifier id'>defines</span> <span class='the identifier id'>the</span> <span class='following identifier id'>following</span> <span class='constants identifier id'>constants</span> <span class='which identifier id'>which</span> <span class='you identifier id'>you</span> <span class='can identifier id'>can</span> <span class='use identifier id'>use</span> <span class='in in kw'>in</span> <span class='add_style identifier id'>add_style</span><span class='dot token'>.</span>
1094
- <span class='NUM_FMT_PERCENT constant id'>NUM_FMT_PERCENT</span> <span class='formats identifier id'>formats</span> <span class='to identifier id'>to</span> <span class='string val'>&quot;0%&quot;</span>
1095
- <span class='NUM_FMT_YYYYMMDD constant id'>NUM_FMT_YYYYMMDD</span> <span class='formats identifier id'>formats</span> <span class='to identifier id'>to</span> <span class='string val'>&quot;yyyy/mm/dd&quot;</span>
1096
- <span class='NUM_FMT_YYYYMMDDHHMMSS constant id'>NUM_FMT_YYYYMMDDHHMMSS</span> <span class='formats identifier id'>formats</span> <span class='to identifier id'>to</span> <span class='string val'>&quot;yyyy/mm/dd hh:mm:ss&quot;</span>
1097
- </pre>
1021
+
1022
+ <p>numFmts for your styles.</p>
1023
+
1024
+ <pre class="code">The default styles, which change based on the system local, are as follows.
1025
+ id formatCode
1026
+ 0 General
1027
+ 1 0
1028
+ 2 0.00
1029
+ 3 #,##0
1030
+ 4 #,##0.00
1031
+ 9 0%
1032
+ 10 0.00%
1033
+ 11 0.00E+00
1034
+ 12 # ?/?
1035
+ 13 # ??/??
1036
+ 14 mm-dd-yy
1037
+ 15 d-mmm-yy
1038
+ 16 d-mmm
1039
+ 17 mmm-yy
1040
+ 18 h:mm AM/PM
1041
+ 19 h:mm:ss AM/PM
1042
+ 20 h:mm
1043
+ 21 h:mm:ss
1044
+ 22 m/d/yy h:mm
1045
+ 37 #,##0 ;(#,##0)
1046
+ 38 #,##0 ;[Red](#,##0)
1047
+ 39 #,##0.00;(#,##0.00)
1048
+ 40 #,##0.00;[Red](#,##0.00)
1049
+ 45 mm:ss
1050
+ 46 [h]:mm:ss
1051
+ 47 mmss.0
1052
+ 48 ##0.0E+0
1053
+ 49 @
1054
+ Axlsx also defines the following constants which you can use in add_style.
1055
+ NUM_FMT_PERCENT formats to &quot;0%&quot;
1056
+ NUM_FMT_YYYYMMDD formats to &quot;yyyy/mm/dd&quot;
1057
+ NUM_FMT_YYYYMMDDHHMMSS formats to &quot;yyyy/mm/dd hh:mm:ss&quot;</pre>
1098
1058
 
1099
1059
 
1100
1060
  </div>
@@ -1137,10 +1097,9 @@ numFmts for your styles.
1137
1097
  <td>
1138
1098
  <pre class="code"><span class="info file"># File 'lib/axlsx/stylesheet/styles.rb', line 66</span>
1139
1099
 
1140
- <span class='def def kw'>def</span> <span class='numFmts identifier id'>numFmts</span>
1141
- <span class='@numFmts ivar id'>@numFmts</span>
1142
- <span class='end end kw'>end</span>
1143
- </pre>
1100
+ <span class='kw'>def</span> <span class='id numFmts'>numFmts</span>
1101
+ <span class='ivar'>@numFmts</span>
1102
+ <span class='kw'>end</span></pre>
1144
1103
  </td>
1145
1104
  </tr>
1146
1105
  </table>
@@ -1161,16 +1120,14 @@ numFmts for your styles.
1161
1120
 
1162
1121
  <div class="note notetag">
1163
1122
  <strong>Note:</strong>
1164
- <div class='inline'><p>
1165
- The recommended way to manage styles is with add_style
1166
- </p>
1123
+ <div class='inline'>
1124
+ <p>The recommended way to manage styles is with add_style</p>
1167
1125
  </div>
1168
1126
  </div>
1169
1127
 
1170
- <p>
1171
- The collection of table styles that will be available to the user in the
1172
- excel UI
1173
- </p>
1128
+
1129
+ <p>The collection of table styles that will be available to the user in the
1130
+ excel UI</p>
1174
1131
 
1175
1132
 
1176
1133
  </div>
@@ -1211,10 +1168,9 @@ excel UI
1211
1168
  <td>
1212
1169
  <pre class="code"><span class="info file"># File 'lib/axlsx/stylesheet/styles.rb', line 115</span>
1213
1170
 
1214
- <span class='def def kw'>def</span> <span class='tableStyles identifier id'>tableStyles</span>
1215
- <span class='@tableStyles ivar id'>@tableStyles</span>
1216
- <span class='end end kw'>end</span>
1217
- </pre>
1171
+ <span class='kw'>def</span> <span class='id tableStyles'>tableStyles</span>
1172
+ <span class='ivar'>@tableStyles</span>
1173
+ <span class='kw'>end</span></pre>
1218
1174
  </td>
1219
1175
  </tr>
1220
1176
  </table>
@@ -1236,9 +1192,8 @@ excel UI
1236
1192
 
1237
1193
  </p><div class="docstring">
1238
1194
  <div class="discussion">
1239
- <p>
1240
- Drastically simplifies style creation and management.
1241
- </p>
1195
+
1196
+ <p>Drastically simplifies style creation and management.</p>
1242
1197
 
1243
1198
 
1244
1199
  </div>
@@ -1248,63 +1203,59 @@ Drastically simplifies style creation and management.
1248
1203
  <div class="examples">
1249
1204
  <h3>Examples:</h3>
1250
1205
 
1251
- <h4><div class='inline'><p>
1252
- You Got Style
1253
- </p>
1206
+ <h4><div class='inline'>
1207
+ <p>You Got Style</p>
1254
1208
  </div></h4>
1255
- <pre class="example code"><span class='require identifier id'>require</span> <span class='string val'>&quot;rubygems&quot;</span> <span class='comment val'># if that is your preferred way to manage gems!</span>
1256
- <span class='require identifier id'>require</span> <span class='string val'>&quot;axlsx&quot;</span>
1209
+ <pre class="example code">require &quot;rubygems&quot; # if that is your preferred way to manage gems!
1210
+ require &quot;axlsx&quot;
1257
1211
 
1258
- <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
1259
- <span class='ws identifier id'>ws</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='add_worksheet identifier id'>add_worksheet</span>
1212
+ p = Axlsx::Package.new
1213
+ ws = p.workbook.add_worksheet
1260
1214
 
1261
- <span class='comment val'># black text on a white background at 14pt with thin borders!</span>
1262
- <span class='title identifier id'>title</span> <span class='assign token'>=</span> <span class='ws identifier id'>ws</span><span class='dot token'>.</span><span class='style identifier id'>style</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span><span class='lparen token'>(</span><span class='symbol val'>:bg_color</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='string val'>&quot;FFFF0000&quot;</span><span class='comma token'>,</span> <span class='symbol val'>:fg_color=</span><span class='gt op'>&gt;</span><span class='string val'>&quot;#FF000000&quot;</span><span class='comma token'>,</span> <span class='symbol val'>:sz=</span><span class='gt op'>&gt;</span><span class='integer val'>14</span><span class='comma token'>,</span> <span class='symbol val'>:border=</span><span class='gt op'>&gt;</span><span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='STYLE_THIN_BORDER constant id'>STYLE_THIN_BORDER</span>
1215
+ # black text on a white background at 14pt with thin borders!
1216
+ title = ws.style.add_style(:bg_color =&gt; &quot;FFFF0000&quot;, :fg_color=&gt;&quot;#FF000000&quot;, :sz=&gt;14, :border=&gt;Axlsx::STYLE_THIN_BORDER
1263
1217
 
1264
- <span class='ws identifier id'>ws</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='symbol val'>:values</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='lbrack token'>[</span><span class='string val'>&quot;Least Popular Pets&quot;</span><span class='rbrack token'>]</span>
1265
- <span class='ws identifier id'>ws</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='symbol val'>:values</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='lbrack token'>[</span><span class='string val'>&quot;&quot;</span><span class='comma token'>,</span> <span class='string val'>&quot;Dry Skinned Reptiles&quot;</span><span class='comma token'>,</span> <span class='string val'>&quot;Bald Cats&quot;</span><span class='comma token'>,</span> <span class='string val'>&quot;Violent Parrots&quot;</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:style=</span><span class='gt op'>&gt;</span><span class='title identifier id'>title</span>
1266
- <span class='ws identifier id'>ws</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='symbol val'>:values</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='lbrack token'>[</span><span class='string val'>&quot;Votes&quot;</span><span class='comma token'>,</span> <span class='integer val'>6</span><span class='comma token'>,</span> <span class='integer val'>4</span><span class='comma token'>,</span> <span class='integer val'>1</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:style=</span><span class='gt op'>&gt;</span><span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='STYLE_THIN_BORDER constant id'>STYLE_THIN_BORDER</span>
1267
- <span class='f identifier id'>f</span> <span class='assign token'>=</span> <span class='File constant id'>File</span><span class='dot token'>.</span><span class='open identifier id'>open</span><span class='lparen token'>(</span><span class='string val'>'example_you_got_style.xlsx'</span><span class='comma token'>,</span> <span class='string val'>'w'</span><span class='rparen token'>)</span>
1268
- <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='f identifier id'>f</span><span class='rparen token'>)</span>
1269
- </pre>
1218
+ ws.add_row :values =&gt; [&quot;Least Popular Pets&quot;]
1219
+ ws.add_row :values =&gt; [&quot;&quot;, &quot;Dry Skinned Reptiles&quot;, &quot;Bald Cats&quot;, &quot;Violent Parrots&quot;], :style=&gt;title
1220
+ ws.add_row :values =&gt; [&quot;Votes&quot;, 6, 4, 1], :style=&gt;Axlsx::STYLE_THIN_BORDER
1221
+ f = File.open('example_you_got_style.xlsx', 'w')
1222
+ p.serialize(f)</pre>
1270
1223
 
1271
- <h4><div class='inline'><p>
1272
- Styling specifically
1273
- </p>
1224
+ <h4><div class='inline'>
1225
+ <p>Styling specifically</p>
1274
1226
  </div></h4>
1275
- <pre class="example code"><span class='comment val'># an example of applying specific styles to specific cells</span>
1276
- <span class='require identifier id'>require</span> <span class='string val'>&quot;rubygems&quot;</span> <span class='comment val'># if that is your preferred way to manage gems!</span>
1277
- <span class='require identifier id'>require</span> <span class='string val'>&quot;axlsx&quot;</span>
1278
-
1279
- <span class='p identifier id'>p</span> <span class='assign token'>=</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
1280
- <span class='ws identifier id'>ws</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='add_worksheet identifier id'>add_worksheet</span>
1281
-
1282
- <span class='comment val'># define your styles</span>
1283
- <span class='title identifier id'>title</span> <span class='assign token'>=</span> <span class='ws identifier id'>ws</span><span class='dot token'>.</span><span class='style identifier id'>style</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span><span class='lparen token'>(</span><span class='symbol val'>:bg_color</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='string val'>&quot;FFFF0000&quot;</span><span class='comma token'>,</span>
1284
- <span class='symbol val'>:fg_color=</span><span class='gt op'>&gt;</span><span class='string val'>&quot;#FF000000&quot;</span><span class='comma token'>,</span>
1285
- <span class='symbol val'>:border=</span><span class='gt op'>&gt;</span><span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='STYLE_THIN_BORDER constant id'>STYLE_THIN_BORDER</span><span class='comma token'>,</span>
1286
- <span class='symbol val'>:alignment=</span><span class='gt op'>&gt;</span><span class='lbrace token'>{</span><span class='symbol val'>:horizontal</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='symbol val'>:center</span><span class='rbrace token'>}</span><span class='rparen token'>)</span>
1287
-
1288
- <span class='date_time identifier id'>date_time</span> <span class='assign token'>=</span> <span class='ws identifier id'>ws</span><span class='dot token'>.</span><span class='style identifier id'>style</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span><span class='lparen token'>(</span><span class='symbol val'>:num_fmt</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='NUM_FMT_YYYYMMDDHHMMSS constant id'>NUM_FMT_YYYYMMDDHHMMSS</span><span class='comma token'>,</span>
1289
- <span class='symbol val'>:border=</span><span class='gt op'>&gt;</span><span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='STYLE_THIN_BORDER constant id'>STYLE_THIN_BORDER</span><span class='rparen token'>)</span>
1290
-
1291
- <span class='percent identifier id'>percent</span> <span class='assign token'>=</span> <span class='ws identifier id'>ws</span><span class='dot token'>.</span><span class='style identifier id'>style</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span><span class='lparen token'>(</span><span class='symbol val'>:num_fmt</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='NUM_FMT_PERCENT constant id'>NUM_FMT_PERCENT</span><span class='comma token'>,</span>
1292
- <span class='symbol val'>:border=</span><span class='gt op'>&gt;</span><span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='STYLE_THIN_BORDER constant id'>STYLE_THIN_BORDER</span><span class='rparen token'>)</span>
1293
-
1294
- <span class='currency identifier id'>currency</span> <span class='assign token'>=</span> <span class='ws identifier id'>ws</span><span class='dot token'>.</span><span class='style identifier id'>style</span><span class='dot token'>.</span><span class='add_style identifier id'>add_style</span><span class='lparen token'>(</span><span class='symbol val'>:format_code=</span><span class='gt op'>&gt;</span><span class='string val'>&quot;¥#,##0;[Red]¥-#,##0&quot;</span><span class='comma token'>,</span>
1295
- <span class='symbol val'>:border=</span><span class='gt op'>&gt;</span><span class='Axlsx constant id'>Axlsx</span><span class='colon2 op'>::</span><span class='STYLE_THIN_BORDER constant id'>STYLE_THIN_BORDER</span><span class='rparen token'>)</span>
1296
-
1297
- <span class='comment val'># build your rows</span>
1298
- <span class='ws identifier id'>ws</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='symbol val'>:values</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='lbrack token'>[</span><span class='string val'>&quot;Genreated At:&quot;</span><span class='comma token'>,</span> <span class='Time constant id'>Time</span><span class='dot token'>.</span><span class='now identifier id'>now</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:styles=</span><span class='gt op'>&gt;</span><span class='lbrack token'>[</span><span class='nil nil kw'>nil</span><span class='comma token'>,</span> <span class='date_time identifier id'>date_time</span><span class='rbrack token'>]</span>
1299
- <span class='ws identifier id'>ws</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='symbol val'>:values</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='lbrack token'>[</span><span class='string val'>&quot;Previous Year Quarterly Profits (JPY)&quot;</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:style=</span><span class='gt op'>&gt;</span><span class='title identifier id'>title</span>
1300
- <span class='ws identifier id'>ws</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='symbol val'>:values</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='lbrack token'>[</span><span class='string val'>&quot;Quarter&quot;</span><span class='comma token'>,</span> <span class='string val'>&quot;Profit&quot;</span><span class='comma token'>,</span> <span class='string val'>&quot;% of Total&quot;</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:style=</span><span class='gt op'>&gt;</span><span class='title identifier id'>title</span>
1301
- <span class='ws identifier id'>ws</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='symbol val'>:values</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='lbrack token'>[</span><span class='string val'>&quot;Q1&quot;</span><span class='comma token'>,</span> <span class='integer val'>4000</span><span class='comma token'>,</span> <span class='integer val'>40</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:style=</span><span class='gt op'>&gt;</span><span class='lbrack token'>[</span><span class='title identifier id'>title</span><span class='comma token'>,</span> <span class='currency identifier id'>currency</span><span class='comma token'>,</span> <span class='percent identifier id'>percent</span><span class='rbrack token'>]</span>
1302
- <span class='ws identifier id'>ws</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='symbol val'>:values</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='lbrack token'>[</span><span class='string val'>&quot;Q2&quot;</span><span class='comma token'>,</span> <span class='integer val'>3000</span><span class='comma token'>,</span> <span class='integer val'>30</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:style=</span><span class='gt op'>&gt;</span><span class='lbrack token'>[</span><span class='title identifier id'>title</span><span class='comma token'>,</span> <span class='currency identifier id'>currency</span><span class='comma token'>,</span> <span class='percent identifier id'>percent</span><span class='rbrack token'>]</span>
1303
- <span class='ws identifier id'>ws</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='symbol val'>:values</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='lbrack token'>[</span><span class='string val'>&quot;Q3&quot;</span><span class='comma token'>,</span> <span class='integer val'>1000</span><span class='comma token'>,</span> <span class='integer val'>10</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:style=</span><span class='gt op'>&gt;</span><span class='lbrack token'>[</span><span class='title identifier id'>title</span><span class='comma token'>,</span> <span class='currency identifier id'>currency</span><span class='comma token'>,</span> <span class='percent identifier id'>percent</span><span class='rbrack token'>]</span>
1304
- <span class='ws identifier id'>ws</span><span class='dot token'>.</span><span class='add_row identifier id'>add_row</span> <span class='symbol val'>:values</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='lbrack token'>[</span><span class='string val'>&quot;Q4&quot;</span><span class='comma token'>,</span> <span class='integer val'>2000</span><span class='comma token'>,</span> <span class='integer val'>20</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='symbol val'>:style=</span><span class='gt op'>&gt;</span><span class='lbrack token'>[</span><span class='title identifier id'>title</span><span class='comma token'>,</span> <span class='currency identifier id'>currency</span><span class='comma token'>,</span> <span class='percent identifier id'>percent</span><span class='rbrack token'>]</span>
1305
- <span class='f identifier id'>f</span> <span class='assign token'>=</span> <span class='File constant id'>File</span><span class='dot token'>.</span><span class='open identifier id'>open</span><span class='lparen token'>(</span><span class='string val'>'example_you_got_style.xlsx'</span><span class='comma token'>,</span> <span class='string val'>'w'</span><span class='rparen token'>)</span>
1306
- <span class='p identifier id'>p</span><span class='dot token'>.</span><span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='f identifier id'>f</span><span class='rparen token'>)</span>
1307
- </pre>
1227
+ <pre class="example code"><span class='comment'># an example of applying specific styles to specific cells
1228
+ </span><span class='id require'>require</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>rubygems</span><span class='tstring_end'>&quot;</span></span> <span class='comment'># if that is your preferred way to manage gems!
1229
+ </span><span class='id require'>require</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>axlsx</span><span class='tstring_end'>&quot;</span></span>
1230
+
1231
+ <span class='id p'>p</span> <span class='op'>=</span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>Package</span><span class='period'>.</span><span class='id new'>new</span>
1232
+ <span class='id ws'>ws</span> <span class='op'>=</span> <span class='id p'>p</span><span class='period'>.</span><span class='id workbook'>workbook</span><span class='period'>.</span><span class='id add_worksheet'>add_worksheet</span>
1233
+
1234
+ <span class='comment'># define your styles
1235
+ </span><span class='id title'>title</span> <span class='op'>=</span> <span class='id ws'>ws</span><span class='period'>.</span><span class='id style'>style</span><span class='period'>.</span><span class='id add_style'>add_style</span><span class='lparen'>(</span><span class='symbol'>:bg_color</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>FFFF0000</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
1236
+ <span class='symbol'>:fg_color</span><span class='op'>=&gt;</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>#FF000000</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
1237
+ <span class='symbol'>:border</span><span class='op'>=&gt;</span><span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>STYLE_THIN_BORDER</span><span class='comma'>,</span>
1238
+ <span class='symbol'>:alignment</span><span class='op'>=&gt;</span><span class='lbrace'>{</span><span class='symbol'>:horizontal</span> <span class='op'>=&gt;</span> <span class='symbol'>:center</span><span class='rbrace'>}</span><span class='rparen'>)</span>
1239
+
1240
+ <span class='id date_time'>date_time</span> <span class='op'>=</span> <span class='id ws'>ws</span><span class='period'>.</span><span class='id style'>style</span><span class='period'>.</span><span class='id add_style'>add_style</span><span class='lparen'>(</span><span class='symbol'>:num_fmt</span> <span class='op'>=&gt;</span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>NUM_FMT_YYYYMMDDHHMMSS</span><span class='comma'>,</span>
1241
+ <span class='symbol'>:border</span><span class='op'>=&gt;</span><span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>STYLE_THIN_BORDER</span><span class='rparen'>)</span>
1242
+
1243
+ <span class='id percent'>percent</span> <span class='op'>=</span> <span class='id ws'>ws</span><span class='period'>.</span><span class='id style'>style</span><span class='period'>.</span><span class='id add_style'>add_style</span><span class='lparen'>(</span><span class='symbol'>:num_fmt</span> <span class='op'>=&gt;</span> <span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>NUM_FMT_PERCENT</span><span class='comma'>,</span>
1244
+ <span class='symbol'>:border</span><span class='op'>=&gt;</span><span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>STYLE_THIN_BORDER</span><span class='rparen'>)</span>
1245
+
1246
+ <span class='id currency'>currency</span> <span class='op'>=</span> <span class='id ws'>ws</span><span class='period'>.</span><span class='id style'>style</span><span class='period'>.</span><span class='id add_style'>add_style</span><span class='lparen'>(</span><span class='symbol'>:format_code</span><span class='op'>=&gt;</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>¥#,##0;[Red]¥-#,##0</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
1247
+ <span class='symbol'>:border</span><span class='op'>=&gt;</span><span class='const'>Axlsx</span><span class='op'>::</span><span class='const'>STYLE_THIN_BORDER</span><span class='rparen'>)</span>
1248
+
1249
+ <span class='comment'># build your rows
1250
+ </span><span class='id ws'>ws</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='symbol'>:values</span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Genreated At:</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='const'>Time</span><span class='period'>.</span><span class='id now'>now</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:styles</span><span class='op'>=&gt;</span><span class='lbracket'>[</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id date_time'>date_time</span><span class='rbracket'>]</span>
1251
+ <span class='id ws'>ws</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='symbol'>:values</span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Previous Year Quarterly Profits (JPY)</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:style</span><span class='op'>=&gt;</span><span class='id title'>title</span>
1252
+ <span class='id ws'>ws</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='symbol'>:values</span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Quarter</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Profit</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>% of Total</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:style</span><span class='op'>=&gt;</span><span class='id title'>title</span>
1253
+ <span class='id ws'>ws</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='symbol'>:values</span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Q1</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='int'>4000</span><span class='comma'>,</span> <span class='int'>40</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:style</span><span class='op'>=&gt;</span><span class='lbracket'>[</span><span class='id title'>title</span><span class='comma'>,</span> <span class='id currency'>currency</span><span class='comma'>,</span> <span class='id percent'>percent</span><span class='rbracket'>]</span>
1254
+ <span class='id ws'>ws</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='symbol'>:values</span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Q2</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='int'>3000</span><span class='comma'>,</span> <span class='int'>30</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:style</span><span class='op'>=&gt;</span><span class='lbracket'>[</span><span class='id title'>title</span><span class='comma'>,</span> <span class='id currency'>currency</span><span class='comma'>,</span> <span class='id percent'>percent</span><span class='rbracket'>]</span>
1255
+ <span class='id ws'>ws</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='symbol'>:values</span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Q3</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='int'>1000</span><span class='comma'>,</span> <span class='int'>10</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:style</span><span class='op'>=&gt;</span><span class='lbracket'>[</span><span class='id title'>title</span><span class='comma'>,</span> <span class='id currency'>currency</span><span class='comma'>,</span> <span class='id percent'>percent</span><span class='rbracket'>]</span>
1256
+ <span class='id ws'>ws</span><span class='period'>.</span><span class='id add_row'>add_row</span> <span class='symbol'>:values</span> <span class='op'>=&gt;</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Q4</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='int'>2000</span><span class='comma'>,</span> <span class='int'>20</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='symbol'>:style</span><span class='op'>=&gt;</span><span class='lbracket'>[</span><span class='id title'>title</span><span class='comma'>,</span> <span class='id currency'>currency</span><span class='comma'>,</span> <span class='id percent'>percent</span><span class='rbracket'>]</span>
1257
+ <span class='id f'>f</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id open'>open</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>example_you_got_style.xlsx</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>w</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
1258
+ <span class='id p'>p</span><span class='period'>.</span><span class='id serialize'>serialize</span><span class='lparen'>(</span><span class='id f'>f</span><span class='rparen'>)</span></pre>
1308
1259
 
1309
1260
  </div>
1310
1261
  <h3>Parameters:</h3>
@@ -1322,9 +1273,8 @@ Styling specifically
1322
1273
 
1323
1274
 
1324
1275
  &mdash;
1325
- <div class='inline'><p>
1326
- a customizable set of options
1327
- </p>
1276
+ <div class='inline'>
1277
+ <p>a customizable set of options</p>
1328
1278
  </div>
1329
1279
 
1330
1280
  </li>
@@ -1343,9 +1293,8 @@ a customizable set of options
1343
1293
  <span class="default">
1344
1294
 
1345
1295
  </span>
1346
- &mdash; <div class='inline'><p>
1347
- The text color
1348
- </p>
1296
+ &mdash; <div class='inline'>
1297
+ <p>The text color</p>
1349
1298
  </div>
1350
1299
  </li>
1351
1300
 
@@ -1355,9 +1304,8 @@ The text color
1355
1304
  <span class="default">
1356
1305
 
1357
1306
  </span>
1358
- &mdash; <div class='inline'><p>
1359
- The text size
1360
- </p>
1307
+ &mdash; <div class='inline'>
1308
+ <p>The text size</p>
1361
1309
  </div>
1362
1310
  </li>
1363
1311
 
@@ -1367,9 +1315,8 @@ The text size
1367
1315
  <span class="default">
1368
1316
 
1369
1317
  </span>
1370
- &mdash; <div class='inline'><p>
1371
- Indicates if the text should be bold
1372
- </p>
1318
+ &mdash; <div class='inline'>
1319
+ <p>Indicates if the text should be bold</p>
1373
1320
  </div>
1374
1321
  </li>
1375
1322
 
@@ -1379,9 +1326,8 @@ Indicates if the text should be bold
1379
1326
  <span class="default">
1380
1327
 
1381
1328
  </span>
1382
- &mdash; <div class='inline'><p>
1383
- Indicates if the text should be italicised
1384
- </p>
1329
+ &mdash; <div class='inline'>
1330
+ <p>Indicates if the text should be italicised</p>
1385
1331
  </div>
1386
1332
  </li>
1387
1333
 
@@ -1391,9 +1337,8 @@ Indicates if the text should be italicised
1391
1337
  <span class="default">
1392
1338
 
1393
1339
  </span>
1394
- &mdash; <div class='inline'><p>
1395
- Indicates if the text should be rendered with a strikethrough
1396
- </p>
1340
+ &mdash; <div class='inline'>
1341
+ <p>Indicates if the text should be rendered with a strikethrough</p>
1397
1342
  </div>
1398
1343
  </li>
1399
1344
 
@@ -1403,9 +1348,8 @@ Indicates if the text should be rendered with a strikethrough
1403
1348
  <span class="default">
1404
1349
 
1405
1350
  </span>
1406
- &mdash; <div class='inline'><p>
1407
- Indicates if the text should be rendered with a shadow
1408
- </p>
1351
+ &mdash; <div class='inline'>
1352
+ <p>Indicates if the text should be rendered with a shadow</p>
1409
1353
  </div>
1410
1354
  </li>
1411
1355
 
@@ -1415,9 +1359,8 @@ Indicates if the text should be rendered with a shadow
1415
1359
  <span class="default">
1416
1360
 
1417
1361
  </span>
1418
- &mdash; <div class='inline'><p>
1419
- The character set to use.
1420
- </p>
1362
+ &mdash; <div class='inline'>
1363
+ <p>The character set to use.</p>
1421
1364
  </div>
1422
1365
  </li>
1423
1366
 
@@ -1427,9 +1370,8 @@ The character set to use.
1427
1370
  <span class="default">
1428
1371
 
1429
1372
  </span>
1430
- &mdash; <div class='inline'><p>
1431
- The font family to use.
1432
- </p>
1373
+ &mdash; <div class='inline'>
1374
+ <p>The font family to use.</p>
1433
1375
  </div>
1434
1376
  </li>
1435
1377
 
@@ -1439,9 +1381,8 @@ The font family to use.
1439
1381
  <span class="default">
1440
1382
 
1441
1383
  </span>
1442
- &mdash; <div class='inline'><p>
1443
- The name of the font to use
1444
- </p>
1384
+ &mdash; <div class='inline'>
1385
+ <p>The name of the font to use</p>
1445
1386
  </div>
1446
1387
  </li>
1447
1388
 
@@ -1451,9 +1392,8 @@ The name of the font to use
1451
1392
  <span class="default">
1452
1393
 
1453
1394
  </span>
1454
- &mdash; <div class='inline'><p>
1455
- The number format to apply
1456
- </p>
1395
+ &mdash; <div class='inline'>
1396
+ <p>The number format to apply</p>
1457
1397
  </div>
1458
1398
  </li>
1459
1399
 
@@ -1463,9 +1403,8 @@ The number format to apply
1463
1403
  <span class="default">
1464
1404
 
1465
1405
  </span>
1466
- &mdash; <div class='inline'><p>
1467
- The formatting to apply. If this is specified, num_fmt is ignored.
1468
- </p>
1406
+ &mdash; <div class='inline'>
1407
+ <p>The formatting to apply. If this is specified, num_fmt is ignored.</p>
1469
1408
  </div>
1470
1409
  </li>
1471
1410
 
@@ -1475,9 +1414,8 @@ The formatting to apply. If this is specified, num_fmt is ignored.
1475
1414
  <span class="default">
1476
1415
 
1477
1416
  </span>
1478
- &mdash; <div class='inline'><p>
1479
- The border style to use.
1480
- </p>
1417
+ &mdash; <div class='inline'>
1418
+ <p>The border style to use.</p>
1481
1419
  </div>
1482
1420
  </li>
1483
1421
 
@@ -1487,9 +1425,8 @@ The border style to use.
1487
1425
  <span class="default">
1488
1426
 
1489
1427
  </span>
1490
- &mdash; <div class='inline'><p>
1491
- The background color to apply to the cell
1492
- </p>
1428
+ &mdash; <div class='inline'>
1429
+ <p>The background color to apply to the cell</p>
1493
1430
  </div>
1494
1431
  </li>
1495
1432
 
@@ -1499,9 +1436,8 @@ The background color to apply to the cell
1499
1436
  <span class="default">
1500
1437
 
1501
1438
  </span>
1502
- &mdash; <div class='inline'><p>
1503
- Indicates if the cell should be hidden
1504
- </p>
1439
+ &mdash; <div class='inline'>
1440
+ <p>Indicates if the cell should be hidden</p>
1505
1441
  </div>
1506
1442
  </li>
1507
1443
 
@@ -1511,9 +1447,8 @@ Indicates if the cell should be hidden
1511
1447
  <span class="default">
1512
1448
 
1513
1449
  </span>
1514
- &mdash; <div class='inline'><p>
1515
- Indicates if the cell should be locked
1516
- </p>
1450
+ &mdash; <div class='inline'>
1451
+ <p>Indicates if the cell should be locked</p>
1517
1452
  </div>
1518
1453
  </li>
1519
1454
 
@@ -1523,9 +1458,8 @@ Indicates if the cell should be locked
1523
1458
  <span class="default">
1524
1459
 
1525
1460
  </span>
1526
- &mdash; <div class='inline'><p>
1527
- A hash defining any of the attributes used in CellAlignment
1528
- </p>
1461
+ &mdash; <div class='inline'>
1462
+ <p>A hash defining any of the attributes used in CellAlignment</p>
1529
1463
  </div>
1530
1464
  </li>
1531
1465
 
@@ -1621,52 +1555,51 @@ A hash defining any of the attributes used in CellAlignment
1621
1555
  <td>
1622
1556
  <pre class="code"><span class="info file"># File 'lib/axlsx/stylesheet/styles.rb', line 191</span>
1623
1557
 
1624
- <span class='def def kw'>def</span> <span class='add_style identifier id'>add_style</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>
1625
-
1626
- <span class='numFmtId identifier id'>numFmtId</span> <span class='assign token'>=</span> <span class='if if kw'>if</span> <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:format_code</span><span class='rbrack token'>]</span>
1627
- <span class='n identifier id'>n</span> <span class='assign token'>=</span> <span class='@numFmts ivar id'>@numFmts</span><span class='dot token'>.</span><span class='map identifier id'>map</span><span class='lbrace token'>{</span> <span class='bitor op'>|</span><span class='f identifier id'>f</span><span class='bitor op'>|</span> <span class='f identifier id'>f</span><span class='dot token'>.</span><span class='numFmtId identifier id'>numFmtId</span> <span class='rbrace token'>}</span><span class='dot token'>.</span><span class='max identifier id'>max</span> <span class='plus op'>+</span> <span class='integer val'>1</span>
1628
- <span class='numFmts identifier id'>numFmts</span> <span class='lshft op'>&lt;&lt;</span> <span class='NumFmt constant id'>NumFmt</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='symbol val'>:numFmtId</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='n identifier id'>n</span><span class='comma token'>,</span> <span class='symbol val'>:formatCode=</span><span class='gt op'>&gt;</span> <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:format_code</span><span class='rbrack token'>]</span><span class='rparen token'>)</span>
1629
- <span class='n identifier id'>n</span>
1630
- <span class='else else kw'>else</span>
1631
- <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:num_fmt</span><span class='rbrack token'>]</span> <span class='orop op'>||</span> <span class='integer val'>0</span>
1632
- <span class='end end kw'>end</span>
1633
-
1634
- <span class='borderId identifier id'>borderId</span> <span class='assign token'>=</span> <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:border</span><span class='rbrack token'>]</span> <span class='orop op'>||</span> <span class='integer val'>0</span>
1635
- <span class='raise identifier id'>raise</span> <span class='ArgumentError constant id'>ArgumentError</span><span class='comma token'>,</span> <span class='string val'>&quot;Invalid borderId&quot;</span> <span class='unless unless_mod kw'>unless</span> <span class='borderId identifier id'>borderId</span> <span class='lt op'>&lt;</span> <span class='borders identifier id'>borders</span><span class='dot token'>.</span><span class='size identifier id'>size</span>
1636
-
1637
- <span class='fill identifier id'>fill</span> <span class='assign token'>=</span> <span class='if if kw'>if</span> <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:bg_color</span><span class='rbrack token'>]</span>
1638
- <span class='color identifier id'>color</span> <span class='assign token'>=</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='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:bg_color</span><span class='rbrack token'>]</span><span class='rparen token'>)</span>
1639
- <span class='pattern identifier id'>pattern</span> <span class='assign token'>=</span> <span class='PatternFill constant id'>PatternFill</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='symbol val'>:patternType</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span><span class='symbol val'>:solid</span><span class='comma token'>,</span> <span class='symbol val'>:fgColor=</span><span class='gt op'>&gt;</span><span class='color identifier id'>color</span><span class='rparen token'>)</span>
1640
- <span class='fills identifier id'>fills</span> <span class='lshft op'>&lt;&lt;</span> <span class='Fill constant id'>Fill</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='pattern identifier id'>pattern</span><span class='rparen token'>)</span>
1641
- <span class='else else kw'>else</span>
1642
- <span class='integer val'>0</span>
1643
- <span class='end end kw'>end</span>
1644
-
1645
- <span class='fontId identifier id'>fontId</span> <span class='assign token'>=</span> <span class='if if kw'>if</span> <span class='lparen token'>(</span><span class='options identifier id'>options</span><span class='dot token'>.</span><span class='values_at identifier id'>values_at</span><span class='lparen token'>(</span><span class='symbol val'>:fg_color</span><span class='comma token'>,</span> <span class='symbol val'>:sz</span><span class='comma token'>,</span> <span class='symbol val'>:b</span><span class='comma token'>,</span> <span class='symbol val'>:i</span><span class='comma token'>,</span> <span class='symbol val'>:strike</span><span class='comma token'>,</span> <span class='symbol val'>:outline</span><span class='comma token'>,</span> <span class='symbol val'>:shadow</span><span class='comma token'>,</span> <span class='symbol val'>:charset</span><span class='comma token'>,</span> <span class='symbol val'>:family</span><span class='comma token'>,</span> <span class='symbol val'>:font_name</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='length identifier id'>length</span><span class='rparen token'>)</span>
1646
- <span class='font identifier id'>font</span> <span class='assign token'>=</span> <span class='Font constant id'>Font</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='rparen token'>)</span>
1647
- <span class='lbrack token'>[</span><span class='symbol val'>:b</span><span class='comma token'>,</span> <span class='symbol val'>:i</span><span class='comma token'>,</span> <span class='symbol val'>:strike</span><span class='comma token'>,</span> <span class='symbol val'>:outline</span><span class='comma token'>,</span> <span class='symbol val'>:shadow</span><span class='comma token'>,</span> <span class='symbol val'>:charset</span><span class='comma token'>,</span> <span class='symbol val'>:family</span><span class='comma token'>,</span> <span class='symbol val'>:sz</span><span class='rbrack token'>]</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='k identifier id'>k</span><span class='bitor op'>|</span> <span class='font identifier id'>font</span><span class='dot token'>.</span><span class='send identifier id'>send</span><span class='lparen token'>(</span><span class='dstring node'>&quot;#{k}=&quot;</span><span class='comma token'>,</span> <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='k identifier id'>k</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='k identifier id'>k</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='nil? fid id'>nil?</span> <span class='rbrace token'>}</span>
1648
- <span class='font identifier id'>font</span><span class='dot token'>.</span><span class='color identifier id'>color</span> <span class='assign token'>=</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='assign token'>=</span><span class='gt op'>&gt;</span> <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:fg_color</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'>:fg_color</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='nil? fid id'>nil?</span>
1649
- <span class='font identifier id'>font</span><span class='dot token'>.</span><span class='name identifier id'>name</span> <span class='assign token'>=</span> <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:font_name</span><span class='rbrack 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'>:font_name</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='nil? fid id'>nil?</span>
1650
- <span class='fonts identifier id'>fonts</span> <span class='lshft op'>&lt;&lt;</span> <span class='font identifier id'>font</span>
1651
- <span class='else else kw'>else</span>
1652
- <span class='integer val'>0</span>
1653
- <span class='end end kw'>end</span>
1654
-
1655
- <span class='applyProtection identifier id'>applyProtection</span> <span class='assign token'>=</span> <span class='lparen token'>(</span><span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:hidden</span><span class='rbrack token'>]</span> <span class='orop op'>||</span> <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:locked</span><span class='rbrack token'>]</span><span class='rparen token'>)</span> <span class='question op'>?</span> <span class='integer val'>1</span> <span class='colon op'>:</span> <span class='integer val'>0</span>
1656
-
1657
- <span class='xf identifier id'>xf</span> <span class='assign token'>=</span> <span class='Xf constant id'>Xf</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='symbol val'>:fillId</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='fill identifier id'>fill</span><span class='comma token'>,</span> <span class='symbol val'>:fontId=</span><span class='gt op'>&gt;</span><span class='fontId identifier id'>fontId</span><span class='comma token'>,</span> <span class='symbol val'>:applyFill=</span><span class='gt op'>&gt;</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='symbol val'>:applyFont=</span><span class='gt op'>&gt;</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='symbol val'>:numFmtId=</span><span class='gt op'>&gt;</span><span class='numFmtId identifier id'>numFmtId</span><span class='comma token'>,</span> <span class='symbol val'>:borderId=</span><span class='gt op'>&gt;</span><span class='borderId identifier id'>borderId</span><span class='comma token'>,</span> <span class='symbol val'>:applyProtection=</span><span class='gt op'>&gt;</span><span class='applyProtection identifier id'>applyProtection</span><span class='rparen token'>)</span>
1658
-
1659
- <span class='if if kw'>if</span> <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:alignment</span><span class='rbrack token'>]</span>
1660
- <span class='xf identifier id'>xf</span><span class='dot token'>.</span><span class='alignment identifier id'>alignment</span> <span class='assign token'>=</span> <span class='CellAlignment constant id'>CellAlignment</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'>:alignment</span><span class='rbrack token'>]</span><span class='rparen token'>)</span>
1661
- <span class='end end kw'>end</span>
1662
-
1663
- <span class='if if kw'>if</span> <span class='applyProtection identifier id'>applyProtection</span>
1664
- <span class='xf identifier id'>xf</span><span class='dot token'>.</span><span class='protection identifier id'>protection</span> <span class='assign token'>=</span> <span class='CellProtection constant id'>CellProtection</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='rparen token'>)</span>
1665
- <span class='end end kw'>end</span>
1666
-
1667
- <span class='cellXfs identifier id'>cellXfs</span> <span class='lshft op'>&lt;&lt;</span> <span class='xf identifier id'>xf</span>
1668
- <span class='end end kw'>end</span>
1669
- </pre>
1558
+ <span class='kw'>def</span> <span class='id add_style'>add_style</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>
1559
+
1560
+ <span class='id numFmtId'>numFmtId</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='symbol'>:format_code</span><span class='rbracket'>]</span>
1561
+ <span class='id n'>n</span> <span class='op'>=</span> <span class='ivar'>@numFmts</span><span class='period'>.</span><span class='id map'>map</span><span class='lbrace'>{</span> <span class='op'>|</span><span class='id f'>f</span><span class='op'>|</span> <span class='id f'>f</span><span class='period'>.</span><span class='id numFmtId'>numFmtId</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id max'>max</span> <span class='op'>+</span> <span class='int'>1</span>
1562
+ <span class='id numFmts'>numFmts</span> <span class='op'>&lt;&lt;</span> <span class='const'>NumFmt</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='symbol'>:numFmtId</span> <span class='op'>=&gt;</span> <span class='id n'>n</span><span class='comma'>,</span> <span class='symbol'>:formatCode</span><span class='op'>=&gt;</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='symbol'>:format_code</span><span class='rbracket'>]</span><span class='rparen'>)</span>
1563
+ <span class='id n'>n</span>
1564
+ <span class='kw'>else</span>
1565
+ <span class='id options'>options</span><span class='lbracket'>[</span><span class='symbol'>:num_fmt</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='int'>0</span>
1566
+ <span class='kw'>end</span>
1567
+
1568
+ <span class='id borderId'>borderId</span> <span class='op'>=</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='symbol'>:border</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='int'>0</span>
1569
+ <span class='id raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Invalid borderId</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>unless</span> <span class='id borderId'>borderId</span> <span class='op'>&lt;</span> <span class='id borders'>borders</span><span class='period'>.</span><span class='id size'>size</span>
1570
+
1571
+ <span class='id fill'>fill</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='symbol'>:bg_color</span><span class='rbracket'>]</span>
1572
+ <span class='id color'>color</span> <span class='op'>=</span> <span class='const'>Color</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='symbol'>:rgb</span><span class='op'>=&gt;</span><span class='id options'>options</span><span class='lbracket'>[</span><span class='symbol'>:bg_color</span><span class='rbracket'>]</span><span class='rparen'>)</span>
1573
+ <span class='id pattern'>pattern</span> <span class='op'>=</span> <span class='const'>PatternFill</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='symbol'>:patternType</span> <span class='op'>=&gt;</span><span class='symbol'>:solid</span><span class='comma'>,</span> <span class='symbol'>:fgColor</span><span class='op'>=&gt;</span><span class='id color'>color</span><span class='rparen'>)</span>
1574
+ <span class='id fills'>fills</span> <span class='op'>&lt;&lt;</span> <span class='const'>Fill</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='id pattern'>pattern</span><span class='rparen'>)</span>
1575
+ <span class='kw'>else</span>
1576
+ <span class='int'>0</span>
1577
+ <span class='kw'>end</span>
1578
+
1579
+ <span class='id fontId'>fontId</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='lparen'>(</span><span class='id options'>options</span><span class='period'>.</span><span class='id values_at'>values_at</span><span class='lparen'>(</span><span class='symbol'>:fg_color</span><span class='comma'>,</span> <span class='symbol'>:sz</span><span class='comma'>,</span> <span class='symbol'>:b</span><span class='comma'>,</span> <span class='symbol'>:i</span><span class='comma'>,</span> <span class='symbol'>:strike</span><span class='comma'>,</span> <span class='symbol'>:outline</span><span class='comma'>,</span> <span class='symbol'>:shadow</span><span class='comma'>,</span> <span class='symbol'>:charset</span><span class='comma'>,</span> <span class='symbol'>:family</span><span class='comma'>,</span> <span class='symbol'>:font_name</span><span class='rparen'>)</span><span class='period'>.</span><span class='id length'>length</span><span class='rparen'>)</span>
1580
+ <span class='id font'>font</span> <span class='op'>=</span> <span class='const'>Font</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='rparen'>)</span>
1581
+ <span class='lbracket'>[</span><span class='symbol'>:b</span><span class='comma'>,</span> <span class='symbol'>:i</span><span class='comma'>,</span> <span class='symbol'>:strike</span><span class='comma'>,</span> <span class='symbol'>:outline</span><span class='comma'>,</span> <span class='symbol'>:shadow</span><span class='comma'>,</span> <span class='symbol'>:charset</span><span class='comma'>,</span> <span class='symbol'>:family</span><span class='comma'>,</span> <span class='symbol'>:sz</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id k'>k</span><span class='op'>|</span> <span class='id font'>font</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 k'>k</span><span class='rbrace'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='id k'>k</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='id k'>k</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id nil?'>nil?</span> <span class='rbrace'>}</span>
1582
+ <span class='id font'>font</span><span class='period'>.</span><span class='id color'>color</span> <span class='op'>=</span> <span class='const'>Color</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='symbol'>:rgb</span> <span class='op'>=&gt;</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='symbol'>:fg_color</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'>:fg_color</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id nil?'>nil?</span>
1583
+ <span class='id font'>font</span><span class='period'>.</span><span class='id name'>name</span> <span class='op'>=</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='symbol'>:font_name</span><span class='rbracket'>]</span> <span class='kw'>unless</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='symbol'>:font_name</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id nil?'>nil?</span>
1584
+ <span class='id fonts'>fonts</span> <span class='op'>&lt;&lt;</span> <span class='id font'>font</span>
1585
+ <span class='kw'>else</span>
1586
+ <span class='int'>0</span>
1587
+ <span class='kw'>end</span>
1588
+
1589
+ <span class='id applyProtection'>applyProtection</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id options'>options</span><span class='lbracket'>[</span><span class='symbol'>:hidden</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='symbol'>:locked</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='int'>1</span> <span class='op'>:</span> <span class='int'>0</span>
1590
+
1591
+ <span class='id xf'>xf</span> <span class='op'>=</span> <span class='const'>Xf</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='symbol'>:fillId</span> <span class='op'>=&gt;</span> <span class='id fill'>fill</span><span class='comma'>,</span> <span class='symbol'>:fontId</span><span class='op'>=&gt;</span><span class='id fontId'>fontId</span><span class='comma'>,</span> <span class='symbol'>:applyFill</span><span class='op'>=&gt;</span><span class='int'>1</span><span class='comma'>,</span> <span class='symbol'>:applyFont</span><span class='op'>=&gt;</span><span class='int'>1</span><span class='comma'>,</span> <span class='symbol'>:numFmtId</span><span class='op'>=&gt;</span><span class='id numFmtId'>numFmtId</span><span class='comma'>,</span> <span class='symbol'>:borderId</span><span class='op'>=&gt;</span><span class='id borderId'>borderId</span><span class='comma'>,</span> <span class='symbol'>:applyProtection</span><span class='op'>=&gt;</span><span class='id applyProtection'>applyProtection</span><span class='rparen'>)</span>
1592
+
1593
+ <span class='kw'>if</span> <span class='id options'>options</span><span class='lbracket'>[</span><span class='symbol'>:alignment</span><span class='rbracket'>]</span>
1594
+ <span class='id xf'>xf</span><span class='period'>.</span><span class='id alignment'>alignment</span> <span class='op'>=</span> <span class='const'>CellAlignment</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'>:alignment</span><span class='rbracket'>]</span><span class='rparen'>)</span>
1595
+ <span class='kw'>end</span>
1596
+
1597
+ <span class='kw'>if</span> <span class='id applyProtection'>applyProtection</span>
1598
+ <span class='id xf'>xf</span><span class='period'>.</span><span class='id protection'>protection</span> <span class='op'>=</span> <span class='const'>CellProtection</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='id options'>options</span><span class='rparen'>)</span>
1599
+ <span class='kw'>end</span>
1600
+
1601
+ <span class='id cellXfs'>cellXfs</span> <span class='op'>&lt;&lt;</span> <span class='id xf'>xf</span>
1602
+ <span class='kw'>end</span></pre>
1670
1603
  </td>
1671
1604
  </tr>
1672
1605
  </table>
@@ -1681,9 +1614,8 @@ A hash defining any of the attributes used in CellAlignment
1681
1614
 
1682
1615
  </p><div class="docstring">
1683
1616
  <div class="discussion">
1684
- <p>
1685
- Serializes the styles document
1686
- </p>
1617
+
1618
+ <p>Serializes the styles document</p>
1687
1619
 
1688
1620
 
1689
1621
  </div>
@@ -1724,17 +1656,16 @@ Serializes the styles document
1724
1656
  <td>
1725
1657
  <pre class="code"><span class="info file"># File 'lib/axlsx/stylesheet/styles.rb', line 239</span>
1726
1658
 
1727
- <span class='def def kw'>def</span> <span class='to_xml identifier id'>to_xml</span><span class='lparen token'>(</span><span class='rparen token'>)</span>
1728
- <span class='builder identifier id'>builder</span> <span class='assign token'>=</span> <span class='Nokogiri constant id'>Nokogiri</span><span class='colon2 op'>::</span><span class='XML constant id'>XML</span><span class='colon2 op'>::</span><span class='Builder constant id'>Builder</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='symbol val'>:encoding</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='ENCODING constant id'>ENCODING</span><span class='rparen token'>)</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='xml identifier id'>xml</span><span class='bitor op'>|</span>
1729
- <span class='xml identifier id'>xml</span><span class='dot token'>.</span><span class='styleSheet identifier id'>styleSheet</span><span class='lparen token'>(</span><span class='symbol val'>:xmlns</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='XML_NS constant id'>XML_NS</span><span class='rparen token'>)</span> <span class='lbrace token'>{</span>
1730
- <span class='lbrack token'>[</span><span class='symbol val'>:numFmts</span><span class='comma token'>,</span> <span class='symbol val'>:fonts</span><span class='comma token'>,</span> <span class='symbol val'>:fills</span><span class='comma token'>,</span> <span class='symbol val'>:borders</span><span class='comma token'>,</span> <span class='symbol val'>:cellStyleXfs</span><span class='comma token'>,</span> <span class='symbol val'>:cellXfs</span><span class='comma token'>,</span> <span class='symbol val'>:dxfs</span><span class='comma token'>,</span> <span class='symbol val'>:tableStyles</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='key identifier id'>key</span><span class='bitor op'>|</span>
1731
- <span class='self self kw'>self</span><span class='dot token'>.</span><span class='instance_values identifier id'>instance_values</span><span class='lbrack token'>[</span><span class='key identifier id'>key</span><span class='dot token'>.</span><span class='to_s identifier id'>to_s</span><span class='rbrack token'>]</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>
1732
- <span class='end end kw'>end</span>
1733
- <span class='rbrace token'>}</span>
1734
- <span class='end end kw'>end</span>
1735
- <span class='builder identifier id'>builder</span><span class='dot token'>.</span><span class='to_xml identifier id'>to_xml</span>
1736
- <span class='end end kw'>end</span>
1737
- </pre>
1659
+ <span class='kw'>def</span> <span class='id to_xml'>to_xml</span><span class='lparen'>(</span><span class='rparen'>)</span>
1660
+ <span class='id builder'>builder</span> <span class='op'>=</span> <span class='const'>Nokogiri</span><span class='op'>::</span><span class='const'>XML</span><span class='op'>::</span><span class='const'>Builder</span><span class='period'>.</span><span class='id new'>new</span><span class='lparen'>(</span><span class='symbol'>:encoding</span> <span class='op'>=&gt;</span> <span class='const'>ENCODING</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id xml'>xml</span><span class='op'>|</span>
1661
+ <span class='id xml'>xml</span><span class='period'>.</span><span class='id styleSheet'>styleSheet</span><span class='lparen'>(</span><span class='symbol'>:xmlns</span> <span class='op'>=&gt;</span> <span class='const'>XML_NS</span><span class='rparen'>)</span> <span class='lbrace'>{</span>
1662
+ <span class='lbracket'>[</span><span class='symbol'>:numFmts</span><span class='comma'>,</span> <span class='symbol'>:fonts</span><span class='comma'>,</span> <span class='symbol'>:fills</span><span class='comma'>,</span> <span class='symbol'>:borders</span><span class='comma'>,</span> <span class='symbol'>:cellStyleXfs</span><span class='comma'>,</span> <span class='symbol'>:cellXfs</span><span class='comma'>,</span> <span class='symbol'>:cellStyles</span><span class='comma'>,</span> <span class='symbol'>:dxfs</span><span class='comma'>,</span> <span class='symbol'>:tableStyles</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 key'>key</span><span class='op'>|</span>
1663
+ <span class='kw'>self</span><span class='period'>.</span><span class='id instance_values'>instance_values</span><span class='lbracket'>[</span><span class='id key'>key</span><span class='period'>.</span><span class='id to_s'>to_s</span><span class='rbracket'>]</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>
1664
+ <span class='kw'>end</span>
1665
+ <span class='rbrace'>}</span>
1666
+ <span class='kw'>end</span>
1667
+ <span class='id builder'>builder</span><span class='period'>.</span><span class='id to_xml'>to_xml</span>
1668
+ <span class='kw'>end</span></pre>
1738
1669
  </td>
1739
1670
  </tr>
1740
1671
  </table>
@@ -1745,9 +1676,9 @@ Serializes the styles document
1745
1676
  </div>
1746
1677
 
1747
1678
  <div id="footer">
1748
- Generated on Wed Nov 23 21:47:57 2011 by
1679
+ Generated on Sat Nov 26 13:16:38 2011 by
1749
1680
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1750
- 0.7.3 (ruby-1.8.7).
1681
+ 0.7.3 (ruby-1.9.3).
1751
1682
  </div>
1752
1683
 
1753
1684
  </body>