docs/Rudder/DSL/Util.html in rudder-0.1.0 vs docs/Rudder/DSL/Util.html in rudder-0.2.0

- old
+ new

@@ -117,11 +117,11 @@ <ul class="summary"> <li class="public "> <span class="summary_signature"> - <a href="#_convert_h_val-instance_method" title="#_convert_h_val (instance method)">#<strong>_convert_h_val</strong>(value) &#x21d2; Object </a> + <a href="#_convert_h_val-instance_method" title="#_convert_h_val (instance method)">#<strong>_convert_h_val</strong>(value, use_name = true) &#x21d2; Object </a> </span> @@ -142,11 +142,11 @@ <li class="public "> <span class="summary_signature"> - <a href="#_deep_to_h-instance_method" title="#_deep_to_h (instance method)">#<strong>_deep_to_h</strong>(hash) &#x21d2; Hash </a> + <a href="#_deep_to_h-instance_method" title="#_deep_to_h (instance method)">#<strong>_deep_to_h</strong>(hash, use_name = true) &#x21d2; Hash </a> </span> @@ -175,11 +175,11 @@ <div class="method_details first"> <h3 class="signature first" id="_convert_h_val-instance_method"> - #<strong>_convert_h_val</strong>(value) &#x21d2; <tt>Object</tt> + #<strong>_convert_h_val</strong>(value, use_name = true) &#x21d2; <tt>Object</tt> @@ -191,49 +191,72 @@ </div> </div> <div class="tags"> + <p class="tag_title">Parameters:</p> +<ul class="param"> + <li> + + <span class='name'>use_name</span> + + + <span class='type'>(<tt>Boolean</tt>)</span> + + + <em class="default">(defaults to: <tt>true</tt>)</em> + + + &mdash; + <div class='inline'> +<p>when true named objects are rendered only by name. Otherwise, renders to +Hash (if able), or returns the object itself.</p> +</div> + + </li> + +</ul> + </div><table class="source_code"> <tr> <td> <pre class="lines"> -30 -31 -32 -33 -34 -35 36 37 38 39 40 41 42 43 44 -45</pre> +45 +46 +47 +48 +49 +50 +51</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/rudder/dsl/util.rb', line 30</span> + <pre class="code"><span class="info file"># File 'lib/rudder/dsl/util.rb', line 36</span> -<span class='kw'>def</span> <span class='id identifier rubyid__convert_h_val'>_convert_h_val</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span> +<span class='kw'>def</span> <span class='id identifier rubyid__convert_h_val'>_convert_h_val</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_use_name'>use_name</span> <span class='op'>=</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='kw'>case</span> <span class='id identifier rubyid_value'>value</span> - <span class='kw'>when</span> <span class='const'>Hash</span> - <span class='id identifier rubyid__deep_to_h'>_deep_to_h</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span> <span class='kw'>when</span> <span class='const'>Array</span> - <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_x'>x</span><span class='op'>|</span> <span class='id identifier rubyid__convert_h_val'>_convert_h_val</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='rparen'>)</span> <span class='rbrace'>}</span> + <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_x'>x</span><span class='op'>|</span> <span class='id identifier rubyid__convert_h_val'>_convert_h_val</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_use_name'>use_name</span><span class='rparen'>)</span> <span class='rbrace'>}</span> <span class='kw'>when</span> <span class='const'>Symbol</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='kw'>else</span> - <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span> <span class='symbol'>:to_h</span> - <span class='id identifier rubyid__deep_to_h'>_deep_to_h</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_h'>to_h</span><span class='rparen'>)</span> + <span class='kw'>if</span> <span class='id identifier rubyid_use_name'>use_name</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:name</span><span class='rparen'>)</span> + <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> + <span class='kw'>elsif</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span> <span class='symbol'>:to_h</span> + <span class='id identifier rubyid__deep_to_h'>_deep_to_h</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_h'>to_h</span><span class='comma'>,</span> <span class='id identifier rubyid_use_name'>use_name</span><span class='rparen'>)</span> <span class='kw'>else</span> <span class='id identifier rubyid_value'>value</span> <span class='kw'>end</span> <span class='kw'>end</span> <span class='kw'>end</span></pre> @@ -243,11 +266,11 @@ </div> <div class="method_details "> <h3 class="signature " id="_deep_to_h-instance_method"> - #<strong>_deep_to_h</strong>(hash) &#x21d2; <tt>Hash</tt> + #<strong>_deep_to_h</strong>(hash, use_name = true) &#x21d2; <tt>Hash</tt> @@ -258,11 +281,34 @@ </div> </div> <div class="tags"> + <p class="tag_title">Parameters:</p> +<ul class="param"> + <li> + + <span class='name'>use_name</span> + + + <span class='type'>(<tt>Boolean</tt>)</span> + + + <em class="default">(defaults to: <tt>true</tt>)</em> + + + &mdash; + <div class='inline'> +<p>when true named objects are rendered only by name. Otherwise, renders to +Hash (if able), or returns the object itself.</p> +</div> + + </li> + +</ul> + <p class="tag_title">Returns:</p> <ul class="return"> <li> @@ -284,25 +330,25 @@ <tr> <td> <pre class="lines"> -17 -18 -19 20 21 22 -23</pre> +23 +24 +25 +26</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/rudder/dsl/util.rb', line 17</span> + <pre class="code"><span class="info file"># File 'lib/rudder/dsl/util.rb', line 20</span> -<span class='kw'>def</span> <span class='id identifier rubyid__deep_to_h'>_deep_to_h</span><span class='lparen'>(</span><span class='id identifier rubyid_hash'>hash</span><span class='rparen'>)</span> +<span class='kw'>def</span> <span class='id identifier rubyid__deep_to_h'>_deep_to_h</span><span class='lparen'>(</span><span class='id identifier rubyid_hash'>hash</span><span class='comma'>,</span> <span class='id identifier rubyid_use_name'>use_name</span> <span class='op'>=</span> <span class='kw'>true</span><span class='rparen'>)</span> <span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='op'>|</span> - <span class='id identifier rubyid_k'>k</span> <span class='op'>=</span> <span class='id identifier rubyid__convert_h_val'>_convert_h_val</span><span class='lparen'>(</span><span class='id identifier rubyid_k'>k</span><span class='rparen'>)</span> - <span class='id identifier rubyid_v'>v</span> <span class='op'>=</span> <span class='id identifier rubyid__convert_h_val'>_convert_h_val</span><span class='lparen'>(</span><span class='id identifier rubyid_v'>v</span><span class='rparen'>)</span> + <span class='id identifier rubyid_k'>k</span> <span class='op'>=</span> <span class='id identifier rubyid__convert_h_val'>_convert_h_val</span><span class='lparen'>(</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_use_name'>use_name</span><span class='rparen'>)</span> + <span class='id identifier rubyid_v'>v</span> <span class='op'>=</span> <span class='id identifier rubyid__convert_h_val'>_convert_h_val</span><span class='lparen'>(</span><span class='id identifier rubyid_v'>v</span><span class='comma'>,</span> <span class='id identifier rubyid_use_name'>use_name</span><span class='rparen'>)</span> <span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span> <span class='id identifier rubyid_v'>v</span><span class='rbracket'>]</span> <span class='kw'>end</span><span class='period'>.</span><span class='id identifier rubyid_to_h'>to_h</span> <span class='kw'>end</span></pre> </td> </tr> @@ -312,10 +358,10 @@ </div> </div> <div id="footer"> - Generated on Thu Aug 1 22:21:14 2019 by + Generated on Fri Aug 2 21:10:13 2019 by <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> 0.9.20 (ruby-2.5.1). </div> </div> \ No newline at end of file