axlsx 1.0.10 → 1.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. data/CHANGELOG.md +14 -0
  2. data/Gemfile +3 -7
  3. data/Gemfile.lock +17 -8
  4. data/README.md +88 -59
  5. data/axlsx.gemspec +9 -3
  6. data/doc/Axlsx.html +482 -248
  7. data/doc/Axlsx/App.html +237 -159
  8. data/doc/Axlsx/Axis.html +75 -51
  9. data/doc/Axlsx/Bar3DChart.html +75 -53
  10. data/doc/Axlsx/BarSeries.html +45 -31
  11. data/doc/Axlsx/Border.html +70 -50
  12. data/doc/Axlsx/BorderPr.html +80 -62
  13. data/doc/Axlsx/CatAxis.html +62 -43
  14. data/doc/Axlsx/CatAxisData.html +23 -16
  15. data/doc/Axlsx/Cell.html +2022 -393
  16. data/doc/Axlsx/CellAlignment.html +103 -75
  17. data/doc/Axlsx/CellProtection.html +44 -30
  18. data/doc/Axlsx/CellStyle.html +66 -46
  19. data/doc/Axlsx/Chart.html +159 -108
  20. data/doc/Axlsx/Color.html +73 -52
  21. data/doc/Axlsx/ContentType.html +20 -14
  22. data/doc/Axlsx/Core.html +29 -20
  23. data/doc/Axlsx/DataTypeValidator.html +27 -19
  24. data/doc/Axlsx/Default.html +39 -27
  25. data/doc/Axlsx/Drawing.html +104 -70
  26. data/doc/Axlsx/Fill.html +33 -23
  27. data/doc/Axlsx/Font.html +132 -98
  28. data/doc/Axlsx/GradientFill.html +70 -48
  29. data/doc/Axlsx/GradientStop.html +31 -21
  30. data/doc/Axlsx/GraphicFrame.html +40 -27
  31. data/doc/Axlsx/Line3DChart.html +62 -43
  32. data/doc/Axlsx/LineSeries.html +37 -25
  33. data/doc/Axlsx/Marker.html +63 -43
  34. data/doc/Axlsx/NumFmt.html +79 -65
  35. data/doc/Axlsx/OneCellAnchor.html +78 -54
  36. data/doc/Axlsx/Override.html +39 -27
  37. data/doc/Axlsx/Package.html +103 -163
  38. data/doc/Axlsx/Parser.html +549 -0
  39. data/doc/Axlsx/PatternFill.html +66 -51
  40. data/doc/Axlsx/Pic.html +230 -123
  41. data/doc/Axlsx/PictureLocking.html +1159 -0
  42. data/doc/Axlsx/Pie3DChart.html +23 -16
  43. data/doc/Axlsx/PieSeries.html +44 -30
  44. data/doc/Axlsx/RegexValidator.html +14 -10
  45. data/doc/Axlsx/Relationship.html +40 -27
  46. data/doc/Axlsx/Relationships.html +20 -14
  47. data/doc/Axlsx/RestrictionValidator.html +25 -17
  48. data/doc/Axlsx/Row.html +73 -53
  49. data/doc/Axlsx/Scaling.html +46 -31
  50. data/doc/Axlsx/SerAxis.html +49 -33
  51. data/doc/Axlsx/Series.html +51 -35
  52. data/doc/Axlsx/SeriesTitle.html +14 -10
  53. data/doc/Axlsx/Styles.html +210 -156
  54. data/doc/Axlsx/TableStyle.html +47 -32
  55. data/doc/Axlsx/TableStyleElement.html +75 -61
  56. data/doc/Axlsx/TableStyles.html +42 -28
  57. data/doc/Axlsx/Title.html +36 -25
  58. data/doc/Axlsx/TwoCellAnchor.html +83 -58
  59. data/doc/Axlsx/ValAxis.html +35 -24
  60. data/doc/Axlsx/ValAxisData.html +13 -9
  61. data/doc/Axlsx/View3D.html +64 -43
  62. data/doc/Axlsx/Workbook.html +305 -147
  63. data/doc/Axlsx/Worksheet.html +567 -271
  64. data/doc/Axlsx/Xf.html +114 -77
  65. data/doc/_index.html +15 -1
  66. data/doc/class_list.html +1 -1
  67. data/doc/css/style.css +1 -1
  68. data/doc/file.LICENSE.html +25 -21
  69. data/doc/file.README.html +89 -66
  70. data/doc/index.html +89 -66
  71. data/doc/js/app.js +4 -4
  72. data/doc/method_list.html +717 -413
  73. data/doc/top-level-namespace.html +1 -1
  74. data/examples/example.rb +52 -25
  75. data/examples/follow_20111202.xlsx +0 -0
  76. data/lib/axlsx.rb +14 -1
  77. data/lib/axlsx/drawing/chart.rb +20 -4
  78. data/lib/axlsx/drawing/drawing.rb +1 -1
  79. data/lib/axlsx/drawing/pic.rb +5 -2
  80. data/lib/axlsx/drawing/picture_locking.rb +72 -0
  81. data/lib/axlsx/package.rb +9 -7
  82. data/lib/axlsx/stylesheet/color.rb +19 -9
  83. data/lib/axlsx/stylesheet/styles.rb +2 -0
  84. data/lib/axlsx/util/constants.rb +6 -0
  85. data/lib/axlsx/util/parser.rb +43 -0
  86. data/lib/axlsx/version.rb +1 -1
  87. data/lib/axlsx/workbook/workbook.rb +21 -1
  88. data/lib/axlsx/workbook/worksheet/cell.rb +159 -7
  89. data/lib/axlsx/workbook/worksheet/row.rb +4 -2
  90. data/lib/axlsx/workbook/worksheet/worksheet.rb +38 -4
  91. data/test/drawing/tc_picture_locking.rb +73 -0
  92. data/test/rels/tc_relationships.rb +0 -1
  93. data/test/stylesheet/tc_styles.rb +0 -12
  94. data/test/tc_package.rb +5 -3
  95. data/test/workbook/tc_workbook.rb +7 -0
  96. data/test/workbook/worksheet/tc_cell.rb +102 -1
  97. data/test/workbook/worksheet/tc_worksheet.rb +17 -0
  98. metadata +79 -19
  99. data/doc/Axlsx/Ar.html +0 -196
  100. data/doc/Axlsx/Ar/ClassMethods.html +0 -188
  101. data/doc/Axlsx/Ar/InstanceMethods.html +0 -108
  102. data/doc/Axlsx/Ar/SingletonMethods.html +0 -312
@@ -94,9 +94,10 @@
94
94
 
95
95
  <h2>Overview</h2><div class="docstring">
96
96
  <div class="discussion">
97
-
98
- <p>An override content part. These parts are automatically created by for you
99
- based on the content of your package.</p>
97
+ <p>
98
+ An override content part. These parts are automatically created by for you
99
+ based on the content of your package.
100
+ </p>
100
101
 
101
102
 
102
103
  </div>
@@ -128,8 +129,9 @@ based on the content of your package.</p>
128
129
 
129
130
 
130
131
 
131
- <span class="summary_desc"><div class='inline'>
132
- <p>The type of content.</p>
132
+ <span class="summary_desc"><div class='inline'><p>
133
+ The type of content.
134
+ </p>
133
135
  </div></span>
134
136
 
135
137
  </li>
@@ -154,8 +156,9 @@ based on the content of your package.</p>
154
156
 
155
157
 
156
158
 
157
- <span class="summary_desc"><div class='inline'>
158
- <p>The name and location of the part.</p>
159
+ <span class="summary_desc"><div class='inline'><p>
160
+ The name and location of the part.
161
+ </p>
159
162
  </div></span>
160
163
 
161
164
  </li>
@@ -192,8 +195,9 @@ based on the content of your package.</p>
192
195
 
193
196
 
194
197
 
195
- <span class="summary_desc"><div class='inline'>
196
- <p>Creates a new Override object.</p>
198
+ <span class="summary_desc"><div class='inline'><p>
199
+ Creates a new Override object.
200
+ </p>
197
201
  </div></span>
198
202
 
199
203
  </li>
@@ -215,8 +219,9 @@ based on the content of your package.</p>
215
219
 
216
220
 
217
221
 
218
- <span class="summary_desc"><div class='inline'>
219
- <p>Serializes the Override object to xml.</p>
222
+ <span class="summary_desc"><div class='inline'><p>
223
+ Serializes the Override object to xml.
224
+ </p>
220
225
  </div></span>
221
226
 
222
227
  </li>
@@ -237,8 +242,9 @@ based on the content of your package.</p>
237
242
 
238
243
  </p><div class="docstring">
239
244
  <div class="discussion">
240
-
241
- <p>Creates a new Override object</p>
245
+ <p>
246
+ Creates a new Override object
247
+ </p>
242
248
 
243
249
 
244
250
  </div>
@@ -259,8 +265,9 @@ based on the content of your package.</p>
259
265
 
260
266
 
261
267
  &mdash;
262
- <div class='inline'>
263
- <p>a customizable set of options</p>
268
+ <div class='inline'><p>
269
+ a customizable set of options
270
+ </p>
264
271
  </div>
265
272
 
266
273
  </li>
@@ -305,9 +312,10 @@ based on the content of your package.</p>
305
312
 
306
313
 
307
314
  &mdash;
308
- <div class='inline'>
309
- <p>An argument error is raised if both PartName and ContentType are not
310
- specified.</p>
315
+ <div class='inline'><p>
316
+ An argument error is raised if both PartName and ContentType are not
317
+ specified.
318
+ </p>
311
319
  </div>
312
320
 
313
321
  </li>
@@ -359,8 +367,9 @@ specified.</p>
359
367
 
360
368
  </p><div class="docstring">
361
369
  <div class="discussion">
362
-
363
- <p>The type of content.</p>
370
+ <p>
371
+ The type of content.
372
+ </p>
364
373
 
365
374
 
366
375
  </div>
@@ -415,8 +424,9 @@ specified.</p>
415
424
 
416
425
  </p><div class="docstring">
417
426
  <div class="discussion">
418
-
419
- <p>The name and location of the part.</p>
427
+ <p>
428
+ The name and location of the part.
429
+ </p>
420
430
 
421
431
 
422
432
  </div>
@@ -475,8 +485,9 @@ specified.</p>
475
485
 
476
486
  </p><div class="docstring">
477
487
  <div class="discussion">
478
-
479
- <p>Serializes the Override object to xml</p>
488
+ <p>
489
+ Serializes the Override object to xml
490
+ </p>
480
491
 
481
492
 
482
493
  </div>
@@ -495,8 +506,9 @@ specified.</p>
495
506
 
496
507
 
497
508
  &mdash;
498
- <div class='inline'>
499
- <p>The document builder instance this objects xml will be added to.</p>
509
+ <div class='inline'><p>
510
+ The document builder instance this objects xml will be added to.
511
+ </p>
500
512
  </div>
501
513
 
502
514
  </li>
@@ -531,7 +543,7 @@ specified.</p>
531
543
  </div>
532
544
 
533
545
  <div id="footer">
534
- Generated on Wed Nov 30 08:53:49 2011 by
546
+ Generated on Mon Dec 5 14:21:11 2011 by
535
547
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
536
548
  0.7.3 (ruby-1.8.7).
537
549
  </div>
@@ -94,10 +94,11 @@
94
94
 
95
95
  <h2>Overview</h2><div class="docstring">
96
96
  <div class="discussion">
97
-
98
- <p>Package is responsible for managing all the bits and peices that Open
97
+ <p>
98
+ Package is responsible for managing all the bits and peices that Open
99
99
  Office XML requires to make a valid xlsx document including valdation and
100
- serialization.</p>
100
+ serialization.
101
+ </p>
101
102
 
102
103
 
103
104
  </div>
@@ -136,31 +137,9 @@ serialization.</p>
136
137
 
137
138
 
138
139
 
139
- <span class="summary_desc"><div class='inline'>
140
- <p>Initializes your package.</p>
141
- </div></span>
142
-
143
- </li>
144
-
145
-
146
- <li class="public ">
147
- <span class="summary_signature">
148
-
149
- <a href="#ruport_table-instance_method" title="#ruport_table (instance method)">- (Object) <strong>ruport_table</strong>(table) </a>
150
-
151
-
152
-
153
- </span>
154
-
155
-
156
-
157
-
158
-
159
-
160
-
161
-
162
- <span class="summary_desc"><div class='inline'>
163
- <p>Accepts a ruport table for serialization to xlsx.</p>
140
+ <span class="summary_desc"><div class='inline'><p>
141
+ Initializes your package.
142
+ </p>
164
143
  </div></span>
165
144
 
166
145
  </li>
@@ -182,8 +161,9 @@ serialization.</p>
182
161
 
183
162
 
184
163
 
185
- <span class="summary_desc"><div class='inline'>
186
- <p>Serialize your workbook to disk as an xlsx document.</p>
164
+ <span class="summary_desc"><div class='inline'><p>
165
+ Serialize your workbook to disk as an xlsx document.
166
+ </p>
187
167
  </div></span>
188
168
 
189
169
  </li>
@@ -205,8 +185,9 @@ serialization.</p>
205
185
 
206
186
 
207
187
 
208
- <span class="summary_desc"><div class='inline'>
209
- <p>Validate all parts of the package against xsd schema.</p>
188
+ <span class="summary_desc"><div class='inline'><p>
189
+ Validate all parts of the package against xsd schema.
190
+ </p>
210
191
  </div></span>
211
192
 
212
193
  </li>
@@ -228,8 +209,9 @@ serialization.</p>
228
209
 
229
210
 
230
211
 
231
- <span class="summary_desc"><div class='inline'>
232
- <p>The workbook this package will serialize or validate.</p>
212
+ <span class="summary_desc"><div class='inline'><p>
213
+ The workbook this package will serialize or validate.
214
+ </p>
233
215
  </div></span>
234
216
 
235
217
  </li>
@@ -271,8 +253,9 @@ serialization.</p>
271
253
 
272
254
  </p><div class="docstring">
273
255
  <div class="discussion">
274
-
275
- <p>Initializes your package</p>
256
+ <p>
257
+ Initializes your package
258
+ </p>
276
259
 
277
260
 
278
261
  </div>
@@ -282,8 +265,9 @@ serialization.</p>
282
265
  <div class="examples">
283
266
  <h3>Examples:</h3>
284
267
 
285
- <h4><div class='inline'>
286
- <p>Package.new :author =&gt; you!’, :workbook =&gt; Workbook.new</p>
268
+ <h4><div class='inline'><p>
269
+ Package.new :author =&gt; &#8216;you!&#8217;, :workbook =&gt; Workbook.new
270
+ </p>
287
271
  </div></h4>
288
272
  <pre class="example code">
289
273
  </pre>
@@ -304,9 +288,10 @@ serialization.</p>
304
288
 
305
289
 
306
290
  &mdash;
307
- <div class='inline'>
308
- <p>A hash that you can use to specify the author and workbook for this
309
- package.</p>
291
+ <div class='inline'><p>
292
+ A hash that you can use to specify the author and workbook for this
293
+ package.
294
+ </p>
310
295
  </div>
311
296
 
312
297
  </li>
@@ -325,8 +310,9 @@ package.</p>
325
310
  <span class="default">
326
311
 
327
312
  </span>
328
- &mdash; <div class='inline'>
329
- <p>The author of the document</p>
313
+ &mdash; <div class='inline'><p>
314
+ The author of the document
315
+ </p>
330
316
  </div>
331
317
  </li>
332
318
 
@@ -359,8 +345,9 @@ package.</p>
359
345
 
360
346
 
361
347
  &mdash;
362
- <div class='inline'>
363
- <p>the object that the method was called on</p>
348
+ <div class='inline'><p>
349
+ the object that the method was called on
350
+ </p>
364
351
  </div>
365
352
 
366
353
  </li>
@@ -403,67 +390,7 @@ package.</p>
403
390
 
404
391
 
405
392
  <div class="method_details first">
406
- <p class="signature first" id="ruport_table-instance_method">
407
-
408
- - (<tt>Object</tt>) <strong>ruport_table</strong>(table)
409
-
410
-
411
-
412
- </p><div class="docstring">
413
- <div class="discussion">
414
-
415
- <p>Accepts a ruport table for serialization to xlsx</p>
416
-
417
-
418
- </div>
419
- </div>
420
- <div class="tags">
421
- <h3>Parameters:</h3>
422
- <ul class="param">
423
-
424
- <li>
425
-
426
- <span class='name'>table</span>
427
-
428
-
429
- <span class='type'>(<tt>Table</tt>)</span>
430
-
431
-
432
-
433
- &mdash;
434
- <div class='inline'>
435
- <p>a ruport Table object</p>
436
- </div>
437
-
438
- </li>
439
-
440
- </ul>
441
-
442
-
443
- </div><table class="source_code">
444
- <tr>
445
- <td>
446
- <pre class="lines">
447
-
448
-
449
- 21
450
- 22
451
- 23</pre>
452
- </td>
453
- <td>
454
- <pre class="code"><span class="info file"># File 'lib/axlsx/package.rb', line 21</span>
455
-
456
- <span class='def def kw'>def</span> <span class='ruport_table identifier id'>ruport_table</span><span class='lparen token'>(</span><span class='table identifier id'>table</span><span class='rparen token'>)</span>
457
- <span class='puts identifier id'>puts</span> <span class='table identifier id'>table</span>
458
- <span class='end end kw'>end</span>
459
- </pre>
460
- </td>
461
- </tr>
462
- </table>
463
- </div>
464
-
465
- <div class="method_details ">
466
- <p class="signature " id="serialize-instance_method">
393
+ <p class="signature first" id="serialize-instance_method">
467
394
 
468
395
  - (<tt>Boolean</tt>) <strong>serialize</strong>(output, confirm_valid = false)
469
396
 
@@ -474,15 +401,17 @@ package.</p>
474
401
 
475
402
  <div class="note notetag">
476
403
  <strong>Note:</strong>
477
- <div class='inline'>
478
- <p>A tremendous amount of effort has gone into ensuring that you cannot create
404
+ <div class='inline'><p>
405
+ A tremendous amount of effort has gone into ensuring that you cannot create
479
406
  invalid xlsx documents. confirm_valid should be used in the rare case that
480
- you cannot open the serialized file.</p>
407
+ you cannot open the serialized file.
408
+ </p>
481
409
  </div>
482
410
  </div>
483
411
 
484
-
485
- <p>Serialize your workbook to disk as an xlsx document.</p>
412
+ <p>
413
+ Serialize your workbook to disk as an xlsx document.
414
+ </p>
486
415
 
487
416
 
488
417
  </div>
@@ -515,8 +444,9 @@ you cannot open the serialized file.</p>
515
444
 
516
445
 
517
446
  &mdash;
518
- <div class='inline'>
519
- <p>The file you want to serialize your package to</p>
447
+ <div class='inline'><p>
448
+ The file you want to serialize your package to
449
+ </p>
520
450
  </div>
521
451
 
522
452
  </li>
@@ -533,8 +463,9 @@ you cannot open the serialized file.</p>
533
463
 
534
464
 
535
465
  &mdash;
536
- <div class='inline'>
537
- <p>Validate the package prior to serialization.</p>
466
+ <div class='inline'><p>
467
+ Validate the package prior to serialization.
468
+ </p>
538
469
  </div>
539
470
 
540
471
  </li>
@@ -552,9 +483,10 @@ you cannot open the serialized file.</p>
552
483
 
553
484
 
554
485
  &mdash;
555
- <div class='inline'>
556
- <p>False if confirm_valid and validation errors exist. True if the package was
557
- serialized</p>
486
+ <div class='inline'><p>
487
+ False if confirm_valid and validation errors exist. True if the package was
488
+ serialized
489
+ </p>
558
490
  </div>
559
491
 
560
492
  </li>
@@ -574,7 +506,6 @@ serialized</p>
574
506
  <pre class="lines">
575
507
 
576
508
 
577
- 61
578
509
  62
579
510
  63
580
511
  64
@@ -591,10 +522,11 @@ serialized</p>
591
522
  75
592
523
  76
593
524
  77
594
- 78</pre>
525
+ 78
526
+ 79</pre>
595
527
  </td>
596
528
  <td>
597
- <pre class="code"><span class="info file"># File 'lib/axlsx/package.rb', line 61</span>
529
+ <pre class="code"><span class="info file"># File 'lib/axlsx/package.rb', line 62</span>
598
530
 
599
531
  <span class='def def kw'>def</span> <span class='serialize identifier id'>serialize</span><span class='lparen token'>(</span><span class='output identifier id'>output</span><span class='comma token'>,</span> <span class='confirm_valid identifier id'>confirm_valid</span><span class='assign token'>=</span><span class='false false kw'>false</span><span class='rparen token'>)</span>
600
532
  <span class='return return kw'>return</span> <span class='false false kw'>false</span> <span class='unless unless_mod kw'>unless</span> <span class='notop op'>!</span><span class='confirm_valid identifier id'>confirm_valid</span> <span class='orop op'>||</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='validate identifier id'>validate</span><span class='dot token'>.</span><span class='empty? fid id'>empty?</span>
@@ -632,22 +564,25 @@ serialized</p>
632
564
 
633
565
  <div class="note notetag">
634
566
  <strong>Note:</strong>
635
- <div class='inline'>
636
- <p>This gem includes all schema from OfficeOpenXML-XMLSchema-Transitional.zip
567
+ <div class='inline'><p>
568
+ This gem includes all schema from OfficeOpenXML-XMLSchema-Transitional.zip
637
569
  and OpenPackagingConventions-XMLSchema.zip as per ECMA-376, Third edition.
638
570
  opc schema require an internet connection to import remote schema from
639
571
  dublin core for dc, dcterms and xml namespaces. Those remote schema are
640
- included in this gem, and the original files have been altered to refer to
641
- the local versions.</p>
642
-
643
- <p>If by chance you are able to creat a package that does not validate it
572
+ included in this gem, and the original files have been altered to refer to
573
+ the local versions.
574
+ </p>
575
+ <p>
576
+ If by chance you are able to creat a package that does not validate it
644
577
  indicates that the internal validation is not robust enough and needs to be
645
- improved. Please report your errors to the gem author.</p>
578
+ improved. Please report your errors to the gem author.
579
+ </p>
646
580
  </div>
647
581
  </div>
648
582
 
649
-
650
- <p>Validate all parts of the package against xsd schema.</p>
583
+ <p>
584
+ Validate all parts of the package against xsd schema.
585
+ </p>
651
586
 
652
587
 
653
588
  </div>
@@ -677,8 +612,9 @@ improved. Please report your errors to the gem author.</p>
677
612
 
678
613
 
679
614
  &mdash;
680
- <div class='inline'>
681
- <p>An array of all validation errors found.</p>
615
+ <div class='inline'><p>
616
+ An array of all validation errors found.
617
+ </p>
682
618
  </div>
683
619
 
684
620
  </li>
@@ -698,14 +634,14 @@ improved. Please report your errors to the gem author.</p>
698
634
  <pre class="lines">
699
635
 
700
636
 
701
- 95
702
- 96
703
637
  97
704
638
  98
705
- 99</pre>
639
+ 99
640
+ 100
641
+ 101</pre>
706
642
  </td>
707
643
  <td>
708
- <pre class="code"><span class="info file"># File 'lib/axlsx/package.rb', line 95</span>
644
+ <pre class="code"><span class="info file"># File 'lib/axlsx/package.rb', line 97</span>
709
645
 
710
646
  <span class='def def kw'>def</span> <span class='validate identifier id'>validate</span>
711
647
  <span class='errors identifier id'>errors</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='rbrack token'>]</span>
@@ -730,23 +666,25 @@ improved. Please report your errors to the gem author.</p>
730
666
 
731
667
  <div class="note notetag">
732
668
  <strong>Note:</strong>
733
- <div class='inline'>
734
- <p>As there are multiple ways to instantiate a workbook for the package, here
735
- are a few examples:</p>
736
-
737
- <pre class="ruby"><span class="ruby-comment"># assign directly during package instanciation</span>
738
- <span class="ruby-identifier">wb</span> = <span class="ruby-constant">Package</span>.<span class="ruby-identifier">new</span>(:<span class="ruby-identifier">workbook</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Workbook</span>.<span class="ruby-identifier">new</span>).<span class="ruby-identifier">workbook</span>
739
-
740
- <span class="ruby-comment"># get a fresh workbook automatically from the package</span>
741
- <span class="ruby-identifier">wb</span> = <span class="ruby-constant">Pacakge</span>.<span class="ruby-identifier">new</span>().<span class="ruby-identifier">workbook</span>
742
- <span class="ruby-comment"># # set the workbook after creating the package</span>
743
- <span class="ruby-identifier">wb</span> = <span class="ruby-constant">Package</span>.<span class="ruby-identifier">new</span>().<span class="ruby-identifier">workbook</span> = <span class="ruby-constant">Workbook</span>.<span class="ruby-identifier">new</span>
669
+ <div class='inline'><p>
670
+ As there are multiple ways to instantiate a workbook for the package, here
671
+ are a few examples:
672
+ </p>
673
+ <pre class="code">
674
+ <span class='comment val'># assign directly during package instanciation</span>
675
+ <span class='wb identifier id'>wb</span> <span class='assign token'>=</span> <span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='symbol val'>:workbook</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='Workbook constant id'>Workbook</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span>
676
+
677
+ <span class='comment val'># get a fresh workbook automatically from the package</span>
678
+ <span class='wb identifier id'>wb</span> <span class='assign token'>=</span> <span class='Pacakge constant id'>Pacakge</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span>
679
+ <span class='comment val'># # set the workbook after creating the package</span>
680
+ <span class='wb identifier id'>wb</span> <span class='assign token'>=</span> <span class='Package constant id'>Package</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='workbook identifier id'>workbook</span> <span class='assign token'>=</span> <span class='Workbook constant id'>Workbook</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
744
681
  </pre>
745
682
  </div>
746
683
  </div>
747
684
 
748
-
749
- <p>The workbook this package will serialize or validate.</p>
685
+ <p>
686
+ The workbook this package will serialize or validate.
687
+ </p>
750
688
 
751
689
 
752
690
  </div>
@@ -777,9 +715,10 @@ are a few examples:</p>
777
715
 
778
716
 
779
717
  &mdash;
780
- <div class='inline'>
781
- <p>If no workbook instance has been assigned with this package a new Workbook
782
- instance is returned.</p>
718
+ <div class='inline'><p>
719
+ If no workbook instance has been assigned with this package a new Workbook
720
+ instance is returned.
721
+ </p>
783
722
  </div>
784
723
 
785
724
  </li>
@@ -796,8 +735,9 @@ instance is returned.</p>
796
735
 
797
736
 
798
737
 
799
- <div class='inline'>
800
- <p>ArgumentError if workbook parameter is not a Workbook instance.</p>
738
+ <div class='inline'><p>
739
+ ArgumentError if workbook parameter is not a Workbook instance.
740
+ </p>
801
741
  </div>
802
742
 
803
743
  </li>
@@ -810,14 +750,14 @@ instance is returned.</p>
810
750
  <pre class="lines">
811
751
 
812
752
 
813
- 37
814
- 38
815
- 39
816
- 40
817
- 41</pre>
753
+ 31
754
+ 32
755
+ 33
756
+ 34
757
+ 35</pre>
818
758
  </td>
819
759
  <td>
820
- <pre class="code"><span class="info file"># File 'lib/axlsx/package.rb', line 37</span>
760
+ <pre class="code"><span class="info file"># File 'lib/axlsx/package.rb', line 31</span>
821
761
 
822
762
  <span class='def def kw'>def</span> <span class='workbook identifier id'>workbook</span>
823
763
  <span class='@workbook ivar id'>@workbook</span> <span class='orop op'>||</span> <span class='@workbook ivar id'>@workbook</span> <span class='assign token'>=</span> <span class='Workbook constant id'>Workbook</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
@@ -859,10 +799,10 @@ instance is returned.</p>
859
799
  <pre class="lines">
860
800
 
861
801
 
862
- 44</pre>
802
+ 45</pre>
863
803
  </td>
864
804
  <td>
865
- <pre class="code"><span class="info file"># File 'lib/axlsx/package.rb', line 44</span>
805
+ <pre class="code"><span class="info file"># File 'lib/axlsx/package.rb', line 45</span>
866
806
 
867
807
  <span class='def def kw'>def</span> <span class='workbook= identifier id'>workbook=</span><span class='lparen token'>(</span><span class='workbook identifier id'>workbook</span><span class='rparen token'>)</span> <span class='DataTypeValidator constant id'>DataTypeValidator</span><span class='dot token'>.</span><span class='validate identifier id'>validate</span> <span class='string val'>&quot;Package.workbook&quot;</span><span class='comma token'>,</span> <span class='Workbook constant id'>Workbook</span><span class='comma token'>,</span> <span class='workbook identifier id'>workbook</span><span class='semicolon token'>;</span> <span class='@workbook ivar id'>@workbook</span> <span class='assign token'>=</span> <span class='workbook identifier id'>workbook</span> <span class='end end kw'>end</span>
868
808
  </pre>
@@ -876,7 +816,7 @@ instance is returned.</p>
876
816
  </div>
877
817
 
878
818
  <div id="footer">
879
- Generated on Wed Nov 30 08:53:51 2011 by
819
+ Generated on Mon Dec 5 14:21:15 2011 by
880
820
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
881
821
  0.7.3 (ruby-1.8.7).
882
822
  </div>