doc/CSVDecision/Data.html in csv_decision-0.0.6 vs doc/CSVDecision/Data.html in csv_decision-0.0.7

- old
+ new

@@ -60,11 +60,11 @@ </div> <div id="content"><h1>Module: CSVDecision::Data - + <span class="private note title">Private</span> </h1> <div class="box_info"> @@ -83,36 +83,30 @@ </div> <h2>Overview</h2><div class="docstring"> <div class="discussion"> - -<p>Methods to load data from a file, CSV string or array of arrays</p> + <p class="note private"> + <strong>This module is part of a private API.</strong> + You should avoid using this module if possible, as it may be removed or be changed in the future. +</p> +<p>Methods to load data from a file, CSV string or an array of arrays.</p> + </div> </div> <div class="tags"> </div> - <h2>Constant Summary</h2> - <dl class="constants"> - - <dt id="CSV_OPTIONS-constant" class="">CSV_OPTIONS = - - </dt> - <dd><pre class="code"><span class='lbrace'>{</span> <span class='label'>encoding:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>UTF-8</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>skip_blanks:</span> <span class='kw'>true</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd> - - </dl> - <h2> Class Method Summary <small><a href="#" class="summary_toggle">collapse</a></small> </h2> @@ -120,66 +114,70 @@ <ul class="summary"> <li class="public "> <span class="summary_signature"> - <a href="#input_file%3F-class_method" title="input_file? (class method)">.<strong>input_file?</strong>(input) &#x21d2; Boolean </a> + <a href="#input_file%3F-class_method" title="input_file? (class method)">.<strong>input_file?</strong>(data) &#x21d2; Boolean </a> </span> - + <span class="private note title">private</span> - <span class="summary_desc"><div class='inline'></div></span> + <span class="summary_desc"><div class='inline'> +<p>If the input is a file name return true, otherwise false.</p> +</div></span> </li> <li class="public "> <span class="summary_signature"> - <a href="#strip_columns-class_method" title="strip_columns (class method)">.<strong>strip_columns</strong>(data:, empty_columns:) &#x21d2; Object </a> + <a href="#strip_columns-class_method" title="strip_columns (class method)">.<strong>strip_columns</strong>(data:, empty_columns:) &#x21d2; Array&lt;Array&lt;String&gt;&gt; </a> </span> - + <span class="private note title">private</span> - <span class="summary_desc"><div class='inline'></div></span> + <span class="summary_desc"><div class='inline'> +<p>Strip the empty columns from the input data rows.</p> +</div></span> </li> <li class="public "> <span class="summary_signature"> - <a href="#to_array-class_method" title="to_array (class method)">.<strong>to_array</strong>(data:) &#x21d2; Object </a> + <a href="#to_array-class_method" title="to_array (class method)">.<strong>to_array</strong>(data:) &#x21d2; Array&lt;Array&lt;String&gt;&gt; </a> </span> - + <span class="private note title">private</span> <span class="summary_desc"><div class='inline'> <p>Parse the input data which may either be a file path name, CSV string or array of arrays.</p> @@ -198,84 +196,179 @@ <div class="method_details first"> <h3 class="signature first" id="input_file?-class_method"> - .<strong>input_file?</strong>(input) &#x21d2; <tt>Boolean</tt> + .<strong>input_file?</strong>(data) &#x21d2; <tt>Boolean</tt> </h3><div class="docstring"> <div class="discussion"> - + <p class="note private"> + <strong>This method is part of a private API.</strong> + You should avoid using this method if possible, as it may be removed or be changed in the future. +</p> +<p>If the input is a file name return true, otherwise false.</p> + + </div> </div> <div class="tags"> + <p class="tag_title">Parameters:</p> +<ul class="param"> + <li> + + <span class='name'>data</span> + + + <span class='type'>(<tt>Pathname</tt>, <tt>File</tt>, <tt>Array&lt;Array&lt;String&gt;&gt;</tt>, <tt>String</tt>)</span> + + + + &mdash; + <div class='inline'> +<p>input data given as a CSV file, array of arrays or CSV string.</p> +</div> + + </li> + +</ul> + <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Boolean</tt>)</span> + &mdash; + <div class='inline'> +<p>Set to true if the input data is passed as a File or Pathname.</p> +</div> + </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> -21 -22 -23</pre> +34 +35 +36</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/csv_decision/data.rb', line 21</span> + <pre class="code"><span class="info file"># File 'lib/csv_decision/data.rb', line 34</span> -<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_input_file?'>input_file?</span><span class='lparen'>(</span><span class='id identifier rubyid_input'>input</span><span class='rparen'>)</span> - <span class='id identifier rubyid_input'>input</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Pathname</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='id identifier rubyid_input'>input</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>File</span><span class='rparen'>)</span> +<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_input_file?'>input_file?</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</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='lparen'>(</span><span class='const'>Pathname</span><span class='rparen'>)</span> <span class='op'>||</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='lparen'>(</span><span class='const'>File</span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="strip_columns-class_method"> - .<strong>strip_columns</strong>(data:, empty_columns:) &#x21d2; <tt>Object</tt> + .<strong>strip_columns</strong>(data:, empty_columns:) &#x21d2; <tt>Array&lt;Array&lt;String&gt;&gt;</tt> -</h3><table class="source_code"> +</h3><div class="docstring"> + <div class="discussion"> + <p class="note private"> + <strong>This method is part of a private API.</strong> + You should avoid using this method if possible, as it may be removed or be changed in the future. +</p> + +<p>Strip the empty columns from the input data rows.</p> + + + </div> +</div> +<div class="tags"> + <p class="tag_title">Parameters:</p> +<ul class="param"> + + <li> + + <span class='name'>empty_columns</span> + + + <span class='type'>(<tt>Array&lt;Index&gt;</tt>)</span> + + + + </li> + + <li> + + <span class='name'>data</span> + + + <span class='type'>(<tt>Pathname</tt>, <tt>File</tt>, <tt>Array&lt;Array&lt;String&gt;&gt;</tt>, <tt>String</tt>)</span> + + + + &mdash; + <div class='inline'> +<p>input data given as a CSV file, array of arrays or CSV string.</p> +</div> + + </li> + +</ul> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Array&lt;Array&lt;String&gt;&gt;</tt>)</span> + + + + &mdash; + <div class='inline'> +<p>Data array stripped of empty columns.</p> +</div> + + </li> + +</ul> + +</div><table class="source_code"> <tr> <td> <pre class="lines"> -25 -26 -27 -28 -29 -30 -31</pre> +43 +44 +45 +46 +47 +48 +49</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/csv_decision/data.rb', line 25</span> + <pre class="code"><span class="info file"># File 'lib/csv_decision/data.rb', line 43</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_strip_columns'>strip_columns</span><span class='lparen'>(</span><span class='label'>data:</span><span class='comma'>,</span> <span class='label'>empty_columns:</span><span class='rparen'>)</span> <span class='comment'># Adjust column indices as we delete columns the rest shift to the left by 1 </span> <span class='id identifier rubyid_empty_columns'>empty_columns</span><span class='period'>.</span><span class='id identifier rubyid_map!'>map!</span><span class='period'>.</span><span class='id identifier rubyid_with_index'>with_index</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_col'>col</span><span class='comma'>,</span> <span class='id identifier rubyid_index'>index</span><span class='op'>|</span> <span class='id identifier rubyid_col'>col</span> <span class='op'>-</span> <span class='id identifier rubyid_index'>index</span> <span class='rbrace'>}</span> @@ -288,40 +381,82 @@ </div> <div class="method_details "> <h3 class="signature " id="to_array-class_method"> - .<strong>to_array</strong>(data:) &#x21d2; <tt>Object</tt> + .<strong>to_array</strong>(data:) &#x21d2; <tt>Array&lt;Array&lt;String&gt;&gt;</tt> </h3><div class="docstring"> <div class="discussion"> - + <p class="note private"> + <strong>This method is part of a private API.</strong> + You should avoid using this method if possible, as it may be removed or be changed in the future. +</p> + <p>Parse the input data which may either be a file path name, CSV string or -array of arrays. Strips out empty columns/rows and comment cells</p> +array of arrays. Strips out empty columns/rows and comment cells.</p> </div> </div> <div class="tags"> + <p class="tag_title">Parameters:</p> +<ul class="param"> + <li> + + <span class='name'>data</span> + + + <span class='type'>(<tt>Pathname</tt>, <tt>File</tt>, <tt>Array&lt;Array&lt;String&gt;&gt;</tt>, <tt>String</tt>)</span> + + + + &mdash; + <div class='inline'> +<p>input data given as a CSV file, array of arrays or CSV string.</p> +</div> + + </li> + +</ul> +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Array&lt;Array&lt;String&gt;&gt;</tt>)</span> + + + + &mdash; + <div class='inline'> +<p>Data array stripped of empty rows.</p> +</div> + + </li> + +</ul> + </div><table class="source_code"> <tr> <td> <pre class="lines"> -17 -18 -19</pre> +26 +27 +28</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/csv_decision/data.rb', line 17</span> + <pre class="code"><span class="info file"># File 'lib/csv_decision/data.rb', line 26</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_array'>to_array</span><span class='lparen'>(</span><span class='label'>data:</span><span class='rparen'>)</span> <span class='id identifier rubyid_strip_rows'>strip_rows</span><span class='lparen'>(</span><span class='label'>data:</span> <span class='id identifier rubyid_data_array'>data_array</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> @@ -332,10 +467,10 @@ </div> </div> <div id="footer"> - Generated on Tue Dec 26 21:20:19 2017 by + Generated on Sat Dec 30 13:04:04 2017 by <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> 0.9.12 (ruby-2.3.0). </div> </div> \ No newline at end of file