mdarray 0.5.5.2-java → 0.5.6-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. checksums.yaml +4 -4
  2. data/config.rb +29 -95
  3. data/doc/BinaryOperator.html +20 -21
  4. data/doc/BitwiseOperators.html +18 -8
  5. data/doc/BitwiseOperators/BinaryAnd.html +189 -0
  6. data/doc/BitwiseOperators/BinaryLeftShift.html +189 -0
  7. data/doc/BitwiseOperators/BinaryOnesComplement.html +189 -0
  8. data/doc/BitwiseOperators/BinaryOr.html +189 -0
  9. data/doc/BitwiseOperators/BinaryRightShift.html +189 -0
  10. data/doc/BitwiseOperators/BinaryXor.html +189 -0
  11. data/doc/BooleanFunctions.html +18 -8
  12. data/doc/BooleanFunctions/And.html +189 -0
  13. data/doc/BooleanFunctions/Not.html +189 -0
  14. data/doc/BooleanFunctions/Or.html +189 -0
  15. data/doc/BooleanMDArray.html +10 -10
  16. data/doc/ByteMDArray.html +73 -14
  17. data/doc/CernDoubleFunctions.html +208 -0
  18. data/doc/CernFloatFunctions.html +208 -0
  19. data/doc/CernFunctions.html +828 -0
  20. data/doc/CernIntFunctions.html +208 -0
  21. data/doc/CernLongFunctions.html +208 -0
  22. data/doc/CharMDArray.html +181 -0
  23. data/doc/Colt.html +18 -20
  24. data/doc/ComparisonOperators.html +18 -8
  25. data/doc/ComparisonOperators/Eq.html +189 -0
  26. data/doc/ComparisonOperators/Ge.html +189 -0
  27. data/doc/ComparisonOperators/Gt.html +189 -0
  28. data/doc/ComparisonOperators/Le.html +189 -0
  29. data/doc/ComparisonOperators/Lt.html +189 -0
  30. data/doc/Const.html +107 -47
  31. data/doc/Csv.html +325 -113
  32. data/doc/Csv/Dimension.html +771 -0
  33. data/doc/Csv/Dimensions.html +654 -0
  34. data/doc/DDescriptive.html +573 -625
  35. data/doc/DoubleMDArray.html +40 -172
  36. data/doc/DoubleStatList.html +19 -20
  37. data/doc/FastBinaryOperator.html +166 -148
  38. data/doc/FastUnaryOperator.html +104 -109
  39. data/doc/FloatMDArray.html +55 -16
  40. data/doc/FunctionCreation.html +53 -273
  41. data/doc/FunctionMap.html +381 -93
  42. data/doc/GenericFunctions.html +18 -8
  43. data/doc/GenericFunctions/Null.html +187 -0
  44. data/doc/IntMDArray.html +77 -16
  45. data/doc/Java/CernJetMathTdouble/DoubleFunctions.html +120 -0
  46. data/doc/Java/CernJetMathTfloat/FloatFunctions.html +120 -0
  47. data/doc/Java/CernJetMathTint/IntFunctions.html +120 -0
  48. data/doc/Java/CernJetMathTlong/LongFunctions.html +120 -0
  49. data/doc/LazyBinaryOperator.html +714 -0
  50. data/doc/LazyMDArray.html +990 -0
  51. data/doc/LazyMDArray/BinaryComp.html +282 -0
  52. data/doc/LazyMDArray/UnaryComp.html +280 -0
  53. data/doc/LazyUnaryOperator.html +537 -0
  54. data/doc/LongMDArray.html +59 -15
  55. data/doc/MDArray.html +3223 -2181
  56. data/doc/MDArray/Counter.html +321 -1233
  57. data/doc/MDArray/IteratorFast.html +177 -116
  58. data/doc/MDArray/IteratorFastBoolean.html +37 -41
  59. data/doc/MDArray/IteratorFastByte.html +46 -39
  60. data/doc/MDArray/IteratorFastChar.html +37 -41
  61. data/doc/MDArray/IteratorFastDouble.html +37 -41
  62. data/doc/MDArray/IteratorFastFloat.html +37 -41
  63. data/doc/MDArray/IteratorFastInt.html +37 -41
  64. data/doc/MDArray/IteratorFastLong.html +37 -41
  65. data/doc/MDArray/IteratorFastShort.html +37 -41
  66. data/doc/MDArray/Section.html +561 -0
  67. data/doc/Nashorn.html +1407 -0
  68. data/doc/NetCDF.html +749 -0
  69. data/doc/NetCDF/Attribute.html +875 -0
  70. data/doc/NetCDF/AttributeWriter.html +286 -0
  71. data/doc/NetCDF/CDMNode.html +460 -0
  72. data/doc/NetCDF/Dimension.html +559 -0
  73. data/doc/NetCDF/DimensionWriter.html +642 -0
  74. data/doc/NetCDF/File.html +1593 -0
  75. data/doc/NetCDF/FileParent.html +674 -0
  76. data/doc/NetCDF/FileWriter.html +2875 -0
  77. data/doc/NetCDF/Group.html +685 -0
  78. data/doc/NetCDF/GroupWriter.html +851 -0
  79. data/doc/NetCDF/TimeVariable.html +646 -0
  80. data/doc/NetCDF/Variable.html +2994 -0
  81. data/doc/NetCDF/VariableWriter.html +420 -0
  82. data/doc/NonNumericalMDArray.html +11 -11
  83. data/doc/NumericFunctions.html +38 -30
  84. data/doc/NumericFunctions/Abs.html +189 -0
  85. data/doc/NumericFunctions/Add.html +189 -0
  86. data/doc/NumericFunctions/Ceil.html +189 -0
  87. data/doc/NumericFunctions/Cube.html +189 -0
  88. data/doc/NumericFunctions/Div.html +189 -0
  89. data/doc/NumericFunctions/Floor.html +189 -0
  90. data/doc/NumericFunctions/Fourth.html +189 -0
  91. data/doc/NumericFunctions/IsZero.html +189 -0
  92. data/doc/NumericFunctions/Max.html +189 -0
  93. data/doc/NumericFunctions/Min.html +189 -0
  94. data/doc/NumericFunctions/Mul.html +189 -0
  95. data/doc/NumericFunctions/Power.html +189 -0
  96. data/doc/NumericFunctions/Square.html +189 -0
  97. data/doc/NumericFunctions/Sub.html +189 -0
  98. data/doc/NumericFunctions/Truncate.html +189 -0
  99. data/doc/NumericalMDArray.html +14 -15
  100. data/doc/Operator.html +318 -109
  101. data/doc/Proc.html +120 -129
  102. data/doc/RubyBinaryOperator.html +66 -70
  103. data/doc/RubyFunctions.html +572 -27
  104. data/doc/RubyMath.html +18 -8
  105. data/doc/RubyMath/Acos.html +189 -0
  106. data/doc/RubyMath/Acosh.html +189 -0
  107. data/doc/RubyMath/Asin.html +189 -0
  108. data/doc/RubyMath/Asinh.html +189 -0
  109. data/doc/RubyMath/Atan.html +189 -0
  110. data/doc/RubyMath/Atan2.html +189 -0
  111. data/doc/RubyMath/Atanh.html +189 -0
  112. data/doc/RubyMath/Cbrt.html +189 -0
  113. data/doc/RubyMath/Cos.html +189 -0
  114. data/doc/RubyMath/Cosh.html +189 -0
  115. data/doc/RubyMath/Erf.html +189 -0
  116. data/doc/RubyMath/Erfc.html +189 -0
  117. data/doc/RubyMath/Exp.html +189 -0
  118. data/doc/RubyMath/Gamma.html +189 -0
  119. data/doc/RubyMath/Hypot.html +189 -0
  120. data/doc/RubyMath/Ldexp.html +189 -0
  121. data/doc/RubyMath/Log.html +189 -0
  122. data/doc/RubyMath/Log10.html +189 -0
  123. data/doc/RubyMath/Log2.html +189 -0
  124. data/doc/RubyMath/Neg.html +189 -0
  125. data/doc/RubyMath/Sin.html +189 -0
  126. data/doc/RubyMath/Sinh.html +189 -0
  127. data/doc/RubyMath/Sqrt.html +189 -0
  128. data/doc/RubyMath/Tan.html +189 -0
  129. data/doc/RubyMath/Tanh.html +189 -0
  130. data/doc/RubyStats.html +8 -8
  131. data/doc/RubyUnaryOperator.html +61 -65
  132. data/doc/ShortMDArray.html +69 -14
  133. data/doc/Sol.html +700 -0
  134. data/doc/Sol/BarChart.html +181 -0
  135. data/doc/Sol/BaseChart.html +800 -0
  136. data/doc/Sol/Bootstrap.html +1137 -0
  137. data/doc/Sol/Bridge.html +586 -0
  138. data/doc/Sol/Chart.html +1162 -0
  139. data/doc/Sol/CoordinateChart.html +679 -0
  140. data/doc/Sol/Dashboard.html +2094 -0
  141. data/doc/Sol/Dashboard/DCFX.html +786 -0
  142. data/doc/Sol/Dashboard/MyHandle.html +338 -0
  143. data/doc/Sol/Dashboard/MyService.html +202 -0
  144. data/doc/Sol/Dashboard/MyTask.html +291 -0
  145. data/doc/Sol/Interval.html +1213 -0
  146. data/doc/Sol/LineChart.html +346 -0
  147. data/doc/Sol/LinearScale.html +334 -0
  148. data/doc/Sol/Margins.html +219 -0
  149. data/doc/Sol/OrdinalScale.html +263 -0
  150. data/doc/Sol/Scale.html +462 -0
  151. data/doc/Sol/Stack.html +199 -0
  152. data/doc/Sol/TimeScale.html +397 -0
  153. data/doc/StatList.html +110 -125
  154. data/doc/StringMDArray.html +10 -10
  155. data/doc/StructureMDArray.html +10 -10
  156. data/doc/UnaryOperator.html +20 -21
  157. data/doc/UserFunction.html +51 -49
  158. data/doc/_index.html +881 -106
  159. data/doc/class_list.html +8 -3
  160. data/doc/css/style.css +2 -1
  161. data/doc/file.README.html +455 -104
  162. data/doc/file_list.html +7 -2
  163. data/doc/frames.html +5 -7
  164. data/doc/index.html +455 -104
  165. data/doc/js/app.js +7 -2
  166. data/doc/js/full_list.js +11 -3
  167. data/doc/method_list.html +3170 -1233
  168. data/doc/top-level-namespace.html +31 -8
  169. data/lib/colt/matrix/algebra.rb +5 -5
  170. data/lib/mdarray.rb +6 -3
  171. data/lib/mdarray/csv.rb +25 -5
  172. data/lib/mdarray/fast_operators.rb +1 -1
  173. data/lib/mdarray/function_creation.rb +3 -1
  174. data/lib/mdarray/hierarchy.rb +2 -0
  175. data/lib/mdarray/operators.rb +1 -1
  176. data/lib/mdarray/ruby_functions.rb +8 -4
  177. data/lib/mdarray/ruby_math.rb +0 -28
  178. data/test/colt/matrix/test_matrix2d_floatingalgebra.rb +31 -7
  179. data/test/complete.rb +4 -4
  180. data/test/mdarray/PETR4_2014.csv +249 -0
  181. data/test/mdarray/VALE_2014.csv +253 -0
  182. data/test/mdarray/VALE_PETR4.csv +501 -0
  183. data/test/mdarray/arithmetic_casting.rb +1 -0
  184. data/test/mdarray/test_access.rb +1 -0
  185. data/test/mdarray/test_boolean.rb +1 -0
  186. data/test/mdarray/test_comparison.rb +1 -0
  187. data/test/mdarray/test_complete.rb +2 -5
  188. data/test/mdarray/test_counter.rb +1 -0
  189. data/test/mdarray/test_creation.rb +1 -0
  190. data/test/mdarray/test_csv.rb +51 -0
  191. data/test/mdarray/test_error.rb +1 -0
  192. data/test/mdarray/test_non_numeric.rb +1 -1
  193. data/test/mdarray/test_operator.rb +31 -14
  194. data/test/mdarray/test_performance.rb +2 -1
  195. data/test/mdarray/test_printing.rb +1 -0
  196. data/test/mdarray/test_sections.rb +1 -0
  197. data/test/mdarray/test_shape.rb +1 -0
  198. data/test/mdarray/test_trigonometry.rb +1 -0
  199. data/test/mdarray/test_views.rb +1 -0
  200. data/vendor/mdarray.jar +0 -0
  201. data/vendor/{netcdfAll-4.5_0.jar → netcdfAll-4.6.jar} +0 -0
  202. data/vendor/slf4j-jdk14-1.7.12.jar +0 -0
  203. data/version.rb +1 -1
  204. metadata +247 -139
  205. data/lib/env.rb +0 -12
  206. data/lib/mdarray/lazy_mdarray.rb +0 -315
  207. data/lib/mdarray/lazy_operators.rb +0 -174
  208. data/test/env.rb +0 -8
  209. data/test/mdarray/test_lazy.rb +0 -306
@@ -6,18 +6,18 @@
6
6
  <title>
7
7
  Class: Const
8
8
 
9
- &mdash; Documentation by YARD 0.8.5.2
9
+ &mdash; Documentation by YARD 0.8.7.6
10
10
 
11
11
  </title>
12
12
 
13
- <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
14
 
15
- <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
16
 
17
17
  <script type="text/javascript" charset="utf-8">
18
18
  hasFrames = window.top.frames.main ? true : false;
19
19
  relpath = '';
20
- framesUrl = "frames.html#!" + escape(window.location.href);
20
+ framesUrl = "frames.html#!Const.html";
21
21
  </script>
22
22
 
23
23
 
@@ -151,6 +151,30 @@
151
151
  <li class="public ">
152
152
  <span class="summary_signature">
153
153
 
154
+ <a href="#get-instance_method" title="#get (instance method)">- (Object) <strong>get</strong>(index) </a>
155
+
156
+
157
+
158
+ </span>
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+ <span class="summary_desc"><div class='inline'>
169
+ <p>---------------------------------------------------------------------------------------.</p>
170
+ </div></span>
171
+
172
+ </li>
173
+
174
+
175
+ <li class="public ">
176
+ <span class="summary_signature">
177
+
154
178
  <a href="#get_current-instance_method" title="#get_current (instance method)">- (Object) <strong>get_current</strong> </a>
155
179
 
156
180
 
@@ -166,7 +190,7 @@
166
190
 
167
191
 
168
192
  <span class="summary_desc"><div class='inline'>
169
- <p>?????????????????????????????.</p>
193
+ <p>---------------------------------------------------------------------------------------.</p>
170
194
  </div></span>
171
195
 
172
196
  </li>
@@ -190,7 +214,7 @@
190
214
 
191
215
 
192
216
  <span class="summary_desc"><div class='inline'>
193
- <p>?????????????????????????????.</p>
217
+ <p>---------------------------------------------------------------------------------------.</p>
194
218
  </div></span>
195
219
 
196
220
  </li>
@@ -214,7 +238,7 @@
214
238
 
215
239
 
216
240
  <span class="summary_desc"><div class='inline'>
217
- <p>?????????????????????????????.</p>
241
+ <p>---------------------------------------------------------------------------------------.</p>
218
242
  </div></span>
219
243
 
220
244
  </li>
@@ -240,7 +264,7 @@
240
264
 
241
265
 
242
266
  <span class="summary_desc"><div class='inline'>
243
- <p>?????????????????????????????.</p>
267
+ <p>---------------------------------------------------------------------------------------.</p>
244
268
  </div></span>
245
269
 
246
270
  </li>
@@ -263,8 +287,8 @@
263
287
 
264
288
  </h3><div class="docstring">
265
289
  <div class="discussion">
266
- <hr style="height: 10px">
267
- <hr style="height: 10px">
290
+ <hr>
291
+ <hr>
268
292
 
269
293
 
270
294
  </div>
@@ -285,10 +309,9 @@
285
309
  <td>
286
310
  <pre class="code"><span class="info file"># File 'lib/mdarray/operators.rb', line 39</span>
287
311
 
288
- <span class='rubyid_def def kw'>def</span> <span class='rubyid_initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='rubyid_value identifier id'>value</span><span class='rparen token'>)</span>
289
- <span class='rubyid_@value ivar id'>@value</span> <span class='assign token'>=</span> <span class='rubyid_value identifier id'>value</span>
290
- <span class='rubyid_end end kw'>end</span>
291
- </pre>
312
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
313
+ <span class='ivar'>@value</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
314
+ <span class='kw'>end</span></pre>
292
315
  </td>
293
316
  </tr>
294
317
  </table>
@@ -334,10 +357,9 @@
334
357
  <td>
335
358
  <pre class="code"><span class="info file"># File 'lib/mdarray/operators.rb', line 33</span>
336
359
 
337
- <span class='rubyid_def def kw'>def</span> <span class='rubyid_value identifier id'>value</span>
338
- <span class='rubyid_@value ivar id'>@value</span>
339
- <span class='rubyid_end end kw'>end</span>
340
- </pre>
360
+ <span class='kw'>def</span> <span class='id identifier rubyid_value'>value</span>
361
+ <span class='ivar'>@value</span>
362
+ <span class='kw'>end</span></pre>
341
363
  </td>
342
364
  </tr>
343
365
  </table>
@@ -351,7 +373,48 @@
351
373
 
352
374
 
353
375
  <div class="method_details first">
354
- <h3 class="signature first" id="get_current-instance_method">
376
+ <h3 class="signature first" id="get-instance_method">
377
+
378
+ - (<tt>Object</tt>) <strong>get</strong>(index)
379
+
380
+
381
+
382
+
383
+
384
+ </h3><div class="docstring">
385
+ <div class="discussion">
386
+ <hr>
387
+ <hr>
388
+
389
+
390
+ </div>
391
+ </div>
392
+ <div class="tags">
393
+
394
+
395
+ </div><table class="source_code">
396
+ <tr>
397
+ <td>
398
+ <pre class="lines">
399
+
400
+
401
+ 55
402
+ 56
403
+ 57</pre>
404
+ </td>
405
+ <td>
406
+ <pre class="code"><span class="info file"># File 'lib/mdarray/operators.rb', line 55</span>
407
+
408
+ <span class='kw'>def</span> <span class='id identifier rubyid_get'>get</span><span class='lparen'>(</span><span class='id identifier rubyid_index'>index</span><span class='rparen'>)</span>
409
+ <span class='ivar'>@value</span>
410
+ <span class='kw'>end</span></pre>
411
+ </td>
412
+ </tr>
413
+ </table>
414
+ </div>
415
+
416
+ <div class="method_details ">
417
+ <h3 class="signature " id="get_current-instance_method">
355
418
 
356
419
  - (<tt>Object</tt>) <strong>get_current</strong>
357
420
 
@@ -361,8 +424,8 @@
361
424
 
362
425
  </h3><div class="docstring">
363
426
  <div class="discussion">
364
- <hr style="height: 10px">
365
- <hr style="height: 10px">
427
+ <hr>
428
+ <hr>
366
429
 
367
430
 
368
431
  </div>
@@ -376,17 +439,16 @@
376
439
  <pre class="lines">
377
440
 
378
441
 
379
- 63
380
- 64
381
- 65</pre>
442
+ 71
443
+ 72
444
+ 73</pre>
382
445
  </td>
383
446
  <td>
384
- <pre class="code"><span class="info file"># File 'lib/mdarray/operators.rb', line 63</span>
447
+ <pre class="code"><span class="info file"># File 'lib/mdarray/operators.rb', line 71</span>
385
448
 
386
- <span class='rubyid_def def kw'>def</span> <span class='rubyid_get_current identifier id'>get_current</span>
387
- <span class='rubyid_@value ivar id'>@value</span>
388
- <span class='rubyid_end end kw'>end</span>
389
- </pre>
449
+ <span class='kw'>def</span> <span class='id identifier rubyid_get_current'>get_current</span>
450
+ <span class='ivar'>@value</span>
451
+ <span class='kw'>end</span></pre>
390
452
  </td>
391
453
  </tr>
392
454
  </table>
@@ -403,8 +465,8 @@
403
465
 
404
466
  </h3><div class="docstring">
405
467
  <div class="discussion">
406
- <hr style="height: 10px">
407
- <hr style="height: 10px">
468
+ <hr>
469
+ <hr>
408
470
 
409
471
 
410
472
  </div>
@@ -425,10 +487,9 @@
425
487
  <td>
426
488
  <pre class="code"><span class="info file"># File 'lib/mdarray/operators.rb', line 47</span>
427
489
 
428
- <span class='rubyid_def def kw'>def</span> <span class='rubyid_get_iterator_fast identifier id'>get_iterator_fast</span>
429
- <span class='rubyid_return return kw'>return</span> <span class='rubyid_self self kw'>self</span>
430
- <span class='rubyid_end end kw'>end</span>
431
- </pre>
490
+ <span class='kw'>def</span> <span class='id identifier rubyid_get_iterator_fast'>get_iterator_fast</span>
491
+ <span class='kw'>return</span> <span class='kw'>self</span>
492
+ <span class='kw'>end</span></pre>
432
493
  </td>
433
494
  </tr>
434
495
  </table>
@@ -445,8 +506,8 @@
445
506
 
446
507
  </h3><div class="docstring">
447
508
  <div class="discussion">
448
- <hr style="height: 10px">
449
- <hr style="height: 10px">
509
+ <hr>
510
+ <hr>
450
511
 
451
512
 
452
513
  </div>
@@ -460,17 +521,16 @@
460
521
  <pre class="lines">
461
522
 
462
523
 
463
- 55
464
- 56
465
- 57</pre>
524
+ 63
525
+ 64
526
+ 65</pre>
466
527
  </td>
467
528
  <td>
468
- <pre class="code"><span class="info file"># File 'lib/mdarray/operators.rb', line 55</span>
529
+ <pre class="code"><span class="info file"># File 'lib/mdarray/operators.rb', line 63</span>
469
530
 
470
- <span class='rubyid_def def kw'>def</span> <span class='rubyid_get_next identifier id'>get_next</span>
471
- <span class='rubyid_@value ivar id'>@value</span>
472
- <span class='rubyid_end end kw'>end</span>
473
- </pre>
531
+ <span class='kw'>def</span> <span class='id identifier rubyid_get_next'>get_next</span>
532
+ <span class='ivar'>@value</span>
533
+ <span class='kw'>end</span></pre>
474
534
  </td>
475
535
  </tr>
476
536
  </table>
@@ -481,9 +541,9 @@
481
541
  </div>
482
542
 
483
543
  <div id="footer">
484
- Generated on Thu May 16 12:48:41 2013 by
544
+ Generated on Tue Jul 14 18:09:10 2015 by
485
545
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
486
- 0.8.5.2 (ruby-1.9.3).
546
+ 0.8.7.6 (ruby-1.9.3).
487
547
  </div>
488
548
 
489
549
  </body>
@@ -6,18 +6,18 @@
6
6
  <title>
7
7
  Class: Csv
8
8
 
9
- &mdash; Documentation by YARD 0.8.5.2
9
+ &mdash; Documentation by YARD 0.8.7.6
10
10
 
11
11
  </title>
12
12
 
13
- <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
14
 
15
- <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
16
 
17
17
  <script type="text/javascript" charset="utf-8">
18
18
  hasFrames = window.top.frames.main ? true : false;
19
19
  relpath = '';
20
- framesUrl = "frames.html#!" + escape(window.location.href);
20
+ framesUrl = "frames.html#!Csv.html";
21
21
  </script>
22
22
 
23
23
 
@@ -99,6 +99,16 @@
99
99
  </dl>
100
100
  <div class="clear"></div>
101
101
 
102
+ <h2>Defined Under Namespace</h2>
103
+ <p class="children">
104
+
105
+
106
+
107
+
108
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="Csv/Dimension.html" title="Csv::Dimension (class)">Dimension</a></span>, <span class='object_link'><a href="Csv/Dimensions.html" title="Csv::Dimensions (class)">Dimensions</a></span>
109
+
110
+
111
+ </p>
102
112
 
103
113
 
104
114
 
@@ -243,6 +253,30 @@
243
253
  <li class="public ">
244
254
  <span class="summary_signature">
245
255
 
256
+ <a href="#read_file-class_method" title="read_file (class method)">+ (Object) <strong>read_file</strong>(filename, options = {}) </a>
257
+
258
+
259
+
260
+ </span>
261
+
262
+
263
+
264
+
265
+
266
+
267
+
268
+
269
+
270
+ <span class="summary_desc"><div class='inline'>
271
+ <p>------------------------------------------------------------------------------------.</p>
272
+ </div></span>
273
+
274
+ </li>
275
+
276
+
277
+ <li class="public ">
278
+ <span class="summary_signature">
279
+
246
280
  <a href="#read_numeric-class_method" title="read_numeric (class method)">+ (Object) <strong>read_numeric</strong>(filename, headers = false) </a>
247
281
 
248
282
 
@@ -258,7 +292,7 @@
258
292
 
259
293
 
260
294
  <span class="summary_desc"><div class='inline'>
261
- <p>????????????????????????????.</p>
295
+ <p>------------------------------------------------------------------------------------.</p>
262
296
  </div></span>
263
297
 
264
298
  </li>
@@ -299,17 +333,16 @@
299
333
  <pre class="lines">
300
334
 
301
335
 
302
- 13
303
- 14
304
- 15</pre>
336
+ 34
337
+ 35
338
+ 36</pre>
305
339
  </td>
306
340
  <td>
307
- <pre class="code"><span class="info file"># File 'lib/mdarray/csv.rb', line 13</span>
341
+ <pre class="code"><span class="info file"># File 'lib/mdarray/csv.rb', line 34</span>
308
342
 
309
- <span class='rubyid_def def kw'>def</span> <span class='rubyid_epoch identifier id'>epoch</span>
310
- <span class='rubyid_@epoch ivar id'>@epoch</span>
311
- <span class='rubyid_end end kw'>end</span>
312
- </pre>
343
+ <span class='kw'>def</span> <span class='id identifier rubyid_epoch'>epoch</span>
344
+ <span class='ivar'>@epoch</span>
345
+ <span class='kw'>end</span></pre>
313
346
  </td>
314
347
  </tr>
315
348
  </table>
@@ -348,17 +381,16 @@
348
381
  <pre class="lines">
349
382
 
350
383
 
351
- 6
352
- 7
353
- 8</pre>
384
+ 27
385
+ 28
386
+ 29</pre>
354
387
  </td>
355
388
  <td>
356
- <pre class="code"><span class="info file"># File 'lib/mdarray/csv.rb', line 6</span>
389
+ <pre class="code"><span class="info file"># File 'lib/mdarray/csv.rb', line 27</span>
357
390
 
358
- <span class='rubyid_def def kw'>def</span> <span class='rubyid_col_sep identifier id'>col_sep</span>
359
- <span class='rubyid_@col_sep ivar id'>@col_sep</span>
360
- <span class='rubyid_end end kw'>end</span>
361
- </pre>
391
+ <span class='kw'>def</span> <span class='id identifier rubyid_col_sep'>col_sep</span>
392
+ <span class='ivar'>@col_sep</span>
393
+ <span class='kw'>end</span></pre>
362
394
  </td>
363
395
  </tr>
364
396
  </table>
@@ -392,17 +424,16 @@
392
424
  <pre class="lines">
393
425
 
394
426
 
395
- 8
396
- 9
397
- 10</pre>
427
+ 29
428
+ 30
429
+ 31</pre>
398
430
  </td>
399
431
  <td>
400
- <pre class="code"><span class="info file"># File 'lib/mdarray/csv.rb', line 8</span>
432
+ <pre class="code"><span class="info file"># File 'lib/mdarray/csv.rb', line 29</span>
401
433
 
402
- <span class='rubyid_def def kw'>def</span> <span class='rubyid_quote_char identifier id'>quote_char</span>
403
- <span class='rubyid_@quote_char ivar id'>@quote_char</span>
404
- <span class='rubyid_end end kw'>end</span>
405
- </pre>
434
+ <span class='kw'>def</span> <span class='id identifier rubyid_quote_char'>quote_char</span>
435
+ <span class='ivar'>@quote_char</span>
436
+ <span class='kw'>end</span></pre>
406
437
  </td>
407
438
  </tr>
408
439
  </table>
@@ -436,17 +467,16 @@
436
467
  <pre class="lines">
437
468
 
438
469
 
439
- 7
440
- 8
441
- 9</pre>
470
+ 28
471
+ 29
472
+ 30</pre>
442
473
  </td>
443
474
  <td>
444
- <pre class="code"><span class="info file"># File 'lib/mdarray/csv.rb', line 7</span>
475
+ <pre class="code"><span class="info file"># File 'lib/mdarray/csv.rb', line 28</span>
445
476
 
446
- <span class='rubyid_def def kw'>def</span> <span class='rubyid_row_sep identifier id'>row_sep</span>
447
- <span class='rubyid_@row_sep ivar id'>@row_sep</span>
448
- <span class='rubyid_end end kw'>end</span>
449
- </pre>
477
+ <span class='kw'>def</span> <span class='id identifier rubyid_row_sep'>row_sep</span>
478
+ <span class='ivar'>@row_sep</span>
479
+ <span class='kw'>end</span></pre>
450
480
  </td>
451
481
  </tr>
452
482
  </table>
@@ -460,7 +490,186 @@
460
490
 
461
491
 
462
492
  <div class="method_details first">
463
- <h3 class="signature first" id="read_numeric-class_method">
493
+ <h3 class="signature first" id="read_file-class_method">
494
+
495
+ + (<tt>Object</tt>) <strong>read_file</strong>(filename, options = {})
496
+
497
+
498
+
499
+
500
+
501
+ </h3><div class="docstring">
502
+ <div class="discussion">
503
+ <hr>
504
+ <hr>
505
+
506
+
507
+ </div>
508
+ </div>
509
+ <div class="tags">
510
+
511
+
512
+ </div><table class="source_code">
513
+ <tr>
514
+ <td>
515
+ <pre class="lines">
516
+
517
+
518
+ 198
519
+ 199
520
+ 200
521
+ 201
522
+ 202
523
+ 203
524
+ 204
525
+ 205
526
+ 206
527
+ 207
528
+ 208
529
+ 209
530
+ 210
531
+ 211
532
+ 212
533
+ 213
534
+ 214
535
+ 215
536
+ 216
537
+ 217
538
+ 218
539
+ 219
540
+ 220
541
+ 221
542
+ 222
543
+ 223
544
+ 224
545
+ 225
546
+ 226
547
+ 227
548
+ 228
549
+ 229
550
+ 230
551
+ 231
552
+ 232
553
+ 233
554
+ 234
555
+ 235
556
+ 236
557
+ 237
558
+ 238
559
+ 239
560
+ 240
561
+ 241
562
+ 242
563
+ 243
564
+ 244
565
+ 245
566
+ 246
567
+ 247
568
+ 248
569
+ 249
570
+ 250
571
+ 251
572
+ 252
573
+ 253
574
+ 254
575
+ 255
576
+ 256
577
+ 257
578
+ 258
579
+ 259
580
+ 260
581
+ 261
582
+ 262
583
+ 263
584
+ 264
585
+ 265
586
+ 266
587
+ 267
588
+ 268
589
+ 269</pre>
590
+ </td>
591
+ <td>
592
+ <pre class="code"><span class="info file"># File 'lib/mdarray/csv.rb', line 198</span>
593
+
594
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_read_file'>read_file</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
595
+
596
+ <span class='id identifier rubyid_buffer'>buffer</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
597
+ <span class='id identifier rubyid_heading'>heading</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
598
+ <span class='id identifier rubyid_lines'>lines</span> <span class='op'>=</span> <span class='int'>0</span>
599
+ <span class='id identifier rubyid_columns'>columns</span> <span class='op'>=</span> <span class='kw'>nil</span>
600
+
601
+ <span class='comment'># user has to set the headers to true if the file has headers, however, we will force
602
+ </span> <span class='comment'># it to false for reading in order to get an array for each line.
603
+ </span> <span class='id identifier rubyid_hds'>hds</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:headers</span><span class='rbracket'>]</span>
604
+ <span class='comment'># Get the dimensions on the file
605
+ </span> <span class='id identifier rubyid_dimensions_names'>dimensions_names</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:dimensions</span><span class='rparen'>)</span>
606
+ <span class='id identifier rubyid_dimensions'>dimensions</span> <span class='op'>=</span> <span class='const'>Dimensions</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_dimensions_names'>dimensions_names</span><span class='rparen'>)</span>
607
+
608
+ <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='label'>converters:</span> <span class='lbracket'>[</span><span class='symbol'>:numeric</span><span class='comma'>,</span> <span class='symbol'>:date</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>return_headers:</span> <span class='kw'>true</span><span class='rbrace'>}</span> <span class='comment'>#, headers: false}
609
+ </span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
610
+
611
+ <span class='comment'># open the file for reading
612
+ </span> <span class='const'>CSV</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_csv'>csv</span><span class='op'>|</span>
613
+
614
+ <span class='comment'># if file has headers then read the first line
615
+ </span> <span class='kw'>if</span> <span class='id identifier rubyid_hds'>hds</span>
616
+ <span class='id identifier rubyid_i'>i</span> <span class='op'>=</span> <span class='int'>0</span>
617
+ <span class='id identifier rubyid_header'>header</span> <span class='op'>=</span> <span class='id identifier rubyid_csv'>csv</span><span class='period'>.</span><span class='id identifier rubyid_shift'>shift</span><span class='period'>.</span><span class='id identifier rubyid_to_hash'>to_hash</span>
618
+ <span class='id identifier rubyid_header'>header</span><span class='period'>.</span><span class='id identifier rubyid_each_pair'>each_pair</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
619
+ <span class='id identifier rubyid_header'>header</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_i'>i</span>
620
+ <span class='id identifier rubyid_i'>i</span> <span class='op'>+=</span> <span class='int'>1</span>
621
+ <span class='kw'>end</span>
622
+ <span class='kw'>end</span>
623
+
624
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Dimension(s) </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_dimensions_names'>dimensions_names</span><span class='rbrace'>}</span><span class='tstring_content'> are not all in the header </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_header'>header</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>\
625
+ </span>if <span class='op'>!</span><span class='lparen'>(</span><span class='id identifier rubyid_dimensions_names'>dimensions_names</span> <span class='op'>-</span> <span class='id identifier rubyid_header'>header</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
626
+
627
+ <span class='id identifier rubyid_dimensions'>dimensions</span><span class='period'>.</span><span class='id identifier rubyid_dimensions'>dimensions</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Columns</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_header'>header</span>
628
+
629
+ <span class='id identifier rubyid_csv'>csv</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_row'>row</span><span class='op'>|</span>
630
+ <span class='comment'># columns is initialized with the first row.size
631
+ </span> <span class='id identifier rubyid_columns'>columns</span> <span class='op'>||=</span> <span class='id identifier rubyid_row'>row</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span>
632
+ <span class='id identifier rubyid_lines'>lines</span> <span class='op'>+=</span> <span class='int'>1</span>
633
+ <span class='comment'># every row should have the same number of columns
634
+ </span> <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_row'>row</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>!=</span> <span class='id identifier rubyid_columns'>columns</span><span class='rparen'>)</span>
635
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Data does not have the same number of columns for all lines</span><span class='tstring_end'>&quot;</span></span>
636
+ <span class='kw'>end</span>
637
+ <span class='comment'># delete dimensions from data and store them on their proper dimension
638
+ </span> <span class='id identifier rubyid_dimensions_names'>dimensions_names</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_name'>name</span><span class='op'>|</span>
639
+ <span class='id identifier rubyid_dimensions'>dimensions</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_row'>row</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
640
+ <span class='kw'>end</span>
641
+
642
+ <span class='comment'># p row
643
+ </span> <span class='id identifier rubyid_row'>row</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_data'>data</span><span class='op'>|</span>
644
+ <span class='comment'># if it is a Date, then convert it to seconds since epoch
645
+ </span> <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Date</span><span class='rparen'>)</span>
646
+ <span class='id identifier rubyid_buffer'>buffer</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_time'>to_time</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
647
+ <span class='kw'>end</span>
648
+ <span class='comment'># if it is numeric then just add it to the buffer
649
+ </span> <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Numeric</span><span class='rparen'>)</span>
650
+ <span class='id identifier rubyid_buffer'>buffer</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span>
651
+ <span class='kw'>end</span>
652
+ <span class='kw'>end</span>
653
+
654
+ <span class='kw'>end</span>
655
+
656
+ <span class='comment'># reset all dimensions
657
+ </span> <span class='id identifier rubyid_dimensions_names'>dimensions_names</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_name'>name</span><span class='op'>|</span>
658
+ <span class='id identifier rubyid_dimensions'>dimensions</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_reset'>reset</span>
659
+ <span class='kw'>end</span>
660
+
661
+ <span class='lbracket'>[</span><span class='id identifier rubyid_lines'>lines</span><span class='comma'>,</span> <span class='id identifier rubyid_columns'>columns</span><span class='comma'>,</span> <span class='id identifier rubyid_buffer'>buffer</span><span class='comma'>,</span> <span class='id identifier rubyid_header'>header</span><span class='comma'>,</span> <span class='id identifier rubyid_dimensions'>dimensions</span><span class='rbracket'>]</span>
662
+
663
+ <span class='kw'>end</span>
664
+
665
+ <span class='kw'>end</span></pre>
666
+ </td>
667
+ </tr>
668
+ </table>
669
+ </div>
670
+
671
+ <div class="method_details ">
672
+ <h3 class="signature " id="read_numeric-class_method">
464
673
 
465
674
  + (<tt>Object</tt>) <strong>read_numeric</strong>(filename, headers = false)
466
675
 
@@ -470,8 +679,8 @@
470
679
 
471
680
  </h3><div class="docstring">
472
681
  <div class="discussion">
473
- <hr style="height: 10px">
474
- <hr style="height: 10px">
682
+ <hr>
683
+ <hr>
475
684
 
476
685
 
477
686
  </div>
@@ -485,91 +694,94 @@
485
694
  <pre class="lines">
486
695
 
487
696
 
488
- 20
489
- 21
490
- 22
491
- 23
492
- 24
493
- 25
494
- 26
495
- 27
496
- 28
497
- 29
498
- 30
499
- 31
500
- 32
501
- 33
502
- 34
503
- 35
504
- 36
505
- 37
506
- 38
507
- 39
508
- 40
509
- 41
510
- 42
511
- 43
512
- 44
513
- 45
514
- 46
515
- 47
516
- 48
517
- 49
518
- 50
519
- 51
520
- 52
521
- 53
522
- 54
523
- 55
524
- 56
525
- 57
526
- 58
527
- 59</pre>
697
+ 275
698
+ 276
699
+ 277
700
+ 278
701
+ 279
702
+ 280
703
+ 281
704
+ 282
705
+ 283
706
+ 284
707
+ 285
708
+ 286
709
+ 287
710
+ 288
711
+ 289
712
+ 290
713
+ 291
714
+ 292
715
+ 293
716
+ 294
717
+ 295
718
+ 296
719
+ 297
720
+ 298
721
+ 299
722
+ 300
723
+ 301
724
+ 302
725
+ 303
726
+ 304
727
+ 305
728
+ 306
729
+ 307
730
+ 308
731
+ 309
732
+ 310
733
+ 311
734
+ 312
735
+ 313
736
+ 314
737
+ 315
738
+ 316</pre>
528
739
  </td>
529
740
  <td>
530
- <pre class="code"><span class="info file"># File 'lib/mdarray/csv.rb', line 20</span>
741
+ <pre class="code"><span class="info file"># File 'lib/mdarray/csv.rb', line 275</span>
531
742
 
532
- <span class='rubyid_def def kw'>def</span> <span class='rubyid_self self kw'>self</span><span class='dot token'>.</span><span class='rubyid_read_numeric identifier id'>read_numeric</span><span class='lparen token'>(</span><span class='rubyid_filename identifier id'>filename</span><span class='comma token'>,</span> <span class='rubyid_headers identifier id'>headers</span> <span class='assign token'>=</span> <span class='rubyid_false false kw'>false</span><span class='rparen token'>)</span>
743
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_read_numeric'>read_numeric</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_headers'>headers</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
533
744
 
534
- <span class='rubyid_buffer identifier id'>buffer</span> <span class='assign token'>=</span> <span class='rubyid_Array constant id'>Array</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span>
535
- <span class='rubyid_lines identifier id'>lines</span> <span class='assign token'>=</span> <span class='integer val'>0</span>
536
- <span class='rubyid_columns identifier id'>columns</span> <span class='assign token'>=</span> <span class='rubyid_nil nil kw'>nil</span>
745
+ <span class='id identifier rubyid_buffer'>buffer</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
746
+ <span class='id identifier rubyid_heading'>heading</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
747
+ <span class='id identifier rubyid_lines'>lines</span> <span class='op'>=</span> <span class='int'>0</span>
748
+ <span class='id identifier rubyid_columns'>columns</span> <span class='op'>=</span> <span class='kw'>nil</span>
537
749
 
538
- <span class='rubyid_CSV constant id'>CSV</span><span class='dot token'>.</span><span class='rubyid_foreach identifier id'>foreach</span><span class='lparen token'>(</span><span class='rubyid_filename identifier id'>filename</span><span class='comma token'>,</span>
539
- <span class='lbrace token'>{</span><span class='rubyid_return_headers identifier id'>return_headers</span><span class='colon op'>:</span> <span class='rubyid_false false kw'>false</span><span class='comma token'>,</span>
540
- <span class='comment val'># headers: true,</span>
541
- <span class='rubyid_converters identifier id'>converters</span><span class='colon op'>:</span> <span class='lbrack token'>[</span><span class='symbol val'>:numeric</span><span class='comma token'>,</span> <span class='symbol val'>:date</span><span class='rbrack token'>]</span><span class='rbrace token'>}</span> <span class='rparen token'>)</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_row identifier id'>row</span><span class='bitor op'>|</span>
750
+ <span class='const'>CSV</span><span class='period'>.</span><span class='id identifier rubyid_foreach'>foreach</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span>
751
+ <span class='lbrace'>{</span><span class='label'>return_headers:</span> <span class='kw'>false</span><span class='comma'>,</span>
752
+ <span class='comment'># headers: true,
753
+ </span> <span class='label'>converters:</span> <span class='lbracket'>[</span><span class='symbol'>:numeric</span><span class='comma'>,</span> <span class='symbol'>:date</span><span class='rbracket'>]</span><span class='rbrace'>}</span> <span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_row'>row</span><span class='op'>|</span>
542
754
 
543
- <span class='rubyid_if if kw'>if</span> <span class='lparen token'>(</span><span class='rubyid_headers identifier id'>headers</span><span class='rparen token'>)</span>
544
- <span class='rubyid_headers identifier id'>headers</span> <span class='assign token'>=</span> <span class='rubyid_false false kw'>false</span>
545
- <span class='rubyid_next next kw'>next</span>
546
- <span class='rubyid_end end kw'>end</span>
755
+ <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_headers'>headers</span><span class='rparen'>)</span>
756
+ <span class='id identifier rubyid_headers'>headers</span> <span class='op'>=</span> <span class='kw'>false</span>
757
+ <span class='id identifier rubyid_heading'>heading</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_row'>row</span>
758
+ <span class='kw'>next</span>
759
+ <span class='kw'>end</span>
547
760
 
548
- <span class='rubyid_columns identifier id'>columns</span> <span class='opasgn op'>||=</span> <span class='rubyid_row identifier id'>row</span><span class='dot token'>.</span><span class='rubyid_size identifier id'>size</span>
549
- <span class='rubyid_lines identifier id'>lines</span> <span class='opasgn op'>+=</span> <span class='integer val'>1</span>
761
+ <span class='id identifier rubyid_columns'>columns</span> <span class='op'>||=</span> <span class='id identifier rubyid_row'>row</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span>
762
+ <span class='id identifier rubyid_lines'>lines</span> <span class='op'>+=</span> <span class='int'>1</span>
550
763
 
551
- <span class='rubyid_row identifier id'>row</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_data identifier id'>data</span><span class='bitor op'>|</span>
764
+ <span class='id identifier rubyid_row'>row</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_data'>data</span><span class='op'>|</span>
552
765
 
553
- <span class='rubyid_if if kw'>if</span> <span class='lparen token'>(</span><span class='rubyid_row identifier id'>row</span><span class='dot token'>.</span><span class='rubyid_size identifier id'>size</span> <span class='neq op'>!=</span> <span class='rubyid_columns identifier id'>columns</span><span class='rparen token'>)</span>
554
- <span class='rubyid_raise identifier id'>raise</span> <span class='string val'>&quot;Data does not have the same number of columns for all lines&quot;</span>
555
- <span class='rubyid_end end kw'>end</span>
766
+ <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_row'>row</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>!=</span> <span class='id identifier rubyid_columns'>columns</span><span class='rparen'>)</span>
767
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Data does not have the same number of columns for all lines</span><span class='tstring_end'>&quot;</span></span>
768
+ <span class='kw'>end</span>
556
769
 
557
- <span class='comment val'># if it is a Date, then convert it to seconds since epoch</span>
558
- <span class='rubyid_if if kw'>if</span> <span class='lparen token'>(</span><span class='rubyid_data identifier id'>data</span><span class='dot token'>.</span><span class='rubyid_is_a? fid id'>is_a?</span> <span class='rubyid_Date constant id'>Date</span><span class='rparen token'>)</span>
559
- <span class='rubyid_buffer identifier id'>buffer</span> <span class='lshft op'>&lt;&lt;</span> <span class='rubyid_data identifier id'>data</span><span class='dot token'>.</span><span class='rubyid_to_time identifier id'>to_time</span><span class='dot token'>.</span><span class='rubyid_to_i identifier id'>to_i</span>
560
- <span class='rubyid_end end kw'>end</span>
770
+ <span class='comment'># if it is a Date, then convert it to seconds since epoch
771
+ </span> <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Date</span><span class='rparen'>)</span>
772
+ <span class='id identifier rubyid_buffer'>buffer</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_to_time'>to_time</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
773
+ <span class='kw'>end</span>
561
774
 
562
- <span class='rubyid_if if kw'>if</span> <span class='lparen token'>(</span><span class='rubyid_data identifier id'>data</span><span class='dot token'>.</span><span class='rubyid_is_a? fid id'>is_a?</span> <span class='rubyid_Numeric constant id'>Numeric</span><span class='rparen token'>)</span>
563
- <span class='rubyid_buffer identifier id'>buffer</span> <span class='lshft op'>&lt;&lt;</span> <span class='rubyid_data identifier id'>data</span>
564
- <span class='rubyid_end end kw'>end</span>
565
- <span class='rubyid_end end kw'>end</span>
775
+ <span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span> <span class='const'>Numeric</span><span class='rparen'>)</span>
776
+ <span class='id identifier rubyid_buffer'>buffer</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_data'>data</span>
777
+ <span class='kw'>end</span>
778
+ <span class='kw'>end</span>
566
779
 
567
- <span class='rubyid_end end kw'>end</span>
780
+ <span class='kw'>end</span>
568
781
 
569
- <span class='lbrack token'>[</span><span class='rubyid_lines identifier id'>lines</span><span class='comma token'>,</span> <span class='rubyid_columns identifier id'>columns</span><span class='comma token'>,</span> <span class='rubyid_buffer identifier id'>buffer</span><span class='rbrack token'>]</span>
782
+ <span class='lbracket'>[</span><span class='id identifier rubyid_lines'>lines</span><span class='comma'>,</span> <span class='id identifier rubyid_columns'>columns</span><span class='comma'>,</span> <span class='id identifier rubyid_buffer'>buffer</span><span class='comma'>,</span> <span class='id identifier rubyid_heading'>heading</span><span class='rbracket'>]</span>
570
783
 
571
- <span class='rubyid_end end kw'>end</span>
572
- </pre>
784
+ <span class='kw'>end</span></pre>
573
785
  </td>
574
786
  </tr>
575
787
  </table>
@@ -580,9 +792,9 @@
580
792
  </div>
581
793
 
582
794
  <div id="footer">
583
- Generated on Thu May 16 12:48:37 2013 by
795
+ Generated on Tue Jul 14 18:09:00 2015 by
584
796
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
585
- 0.8.5.2 (ruby-1.9.3).
797
+ 0.8.7.6 (ruby-1.9.3).
586
798
  </div>
587
799
 
588
800
  </body>