doc/rdoc/core/classes/Enumerable/Enumerator.html in facets-2.5.1 vs doc/rdoc/core/classes/Enumerable/Enumerator.html in facets-2.5.2

- old
+ new

@@ -79,45 +79,158 @@ <div class="sectiontitle">Methods</div> - <span style="padding-right: 5px;"><a href="#M000458">to_h</a></span> + <span style="padding-right: 5px;"><a href="#M000469">to_h</a></span> + <span style="padding-right: 5px;"><a href="#M000473">to_h_assoc</a></span> + <span style="padding-right: 5px;"><a href="#M000470">to_h_auto</a></span> + <span style="padding-right: 5px;"><a href="#M000472">to_h_flat</a></span> + <span style="padding-right: 5px;"><a href="#M000474">to_h_multi</a></span> + <span style="padding-right: 5px;"><a href="#M000471">to_h_splat</a></span> <div class="sectiontitle">Public Instance methods</div> <div class="method"> <div class="title"> - <a name="M000458"></a><b>to_h</b>(mode=nil) + <a name="M000469"></a><b>to_h</b>(mode=nil) </div> <div class="description"> <p> -Convert an <a href="Enumerator.html">Enumerable::Enumerator</a> object -directly into a hash. +Convert an <a href="Enumerator.html">Enumerable::Enumerator</a> object into +a hash. This is equivalent to <a +href="../Array.html#M000136">Array#to_h</a>. </p> <pre> - e = [1,2,3,4,5].to_enum - e.to_h #=&gt; {5=&gt;nil, 1=&gt;2, 3=&gt;4} - e2 = [1,2,1,3,1,5].to_enum - e2.to_h #=&gt; {1=&gt;5} - e3 = [[1,:a],[2,:b],[3,:c]].to_enum - e3.to_h #=&gt; { 1=&gt;:a, 2=&gt;:b, 3=&gt;:c } + e1 = [[1,:a],[2,:b],[3,:c]].to_enum + e1.to_h #=&gt; { 1=&gt;:a, 2=&gt;:b, 3=&gt;:c } + + e2 = [1,2,3,4,5].to_enum + e2.to_h #=&gt; {5=&gt;nil, 1=&gt;2, 3=&gt;4} + + e3 = [1,2,1,3,1,5].to_enum + e3.to_h #=&gt; {1=&gt;5} </pre> <p> CREDIT: Sandor Szücs </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000458_source')" id="l_M000458_source">+</a> ]</p> - <div id="M000458_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000469_source')" id="l_M000469_source">+</a> ]</p> + <div id="M000469_source" class="dyn-source"> <pre> -<span class="ruby-comment cmt"># File lib/core/facets/to_hash.rb, line 304</span> +<span class="ruby-comment cmt"># File lib/core/facets/to_hash.rb, line 288</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_h</span>(<span class="ruby-identifier">mode</span>=<span class="ruby-keyword kw">nil</span>) <span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">to_h</span>(<span class="ruby-identifier">mode</span>) + <span class="ruby-keyword kw">end</span> +</pre> + </div> +</div> +</div> +<div class="method"> + <div class="title"> + <a name="M000473"></a><b>to_h_assoc</b>() + </div> + <div class="description"> + <p> +This is equivalent to <a href="../Array.html#M000140">Array#to_h_assoc</a>. +</p> + </div> +<div class="sourcecode"> + <p class="source-link">[ <a href="javascript:toggleSource('M000473_source')" id="l_M000473_source">+</a> ]</p> + <div id="M000473_source" class="dyn-source"> +<pre> +<span class="ruby-comment cmt"># File lib/core/facets/to_hash.rb, line 312</span> + <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_h_assoc</span> + <span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">to_h_assoc</span> + <span class="ruby-keyword kw">end</span> +</pre> + </div> +</div> +</div> +<div class="method"> + <div class="title"> + <a name="M000470"></a><b>to_h_auto</b>() + </div> + <div class="description"> + <p> +This is equivalent to <a href="../Array.html#M000137">Array#to_h_auto</a>. +</p> + </div> +<div class="sourcecode"> + <p class="source-link">[ <a href="javascript:toggleSource('M000470_source')" id="l_M000470_source">+</a> ]</p> + <div id="M000470_source" class="dyn-source"> +<pre> +<span class="ruby-comment cmt"># File lib/core/facets/to_hash.rb, line 294</span> + <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_h_auto</span> + <span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">to_h_auto</span> + <span class="ruby-keyword kw">end</span> +</pre> + </div> +</div> +</div> +<div class="method"> + <div class="title"> + <a name="M000472"></a><b>to_h_flat</b>() + </div> + <div class="description"> + <p> +This is equivalent to <a href="../Array.html#M000139">Array#to_h_flat</a>. +</p> + </div> +<div class="sourcecode"> + <p class="source-link">[ <a href="javascript:toggleSource('M000472_source')" id="l_M000472_source">+</a> ]</p> + <div id="M000472_source" class="dyn-source"> +<pre> +<span class="ruby-comment cmt"># File lib/core/facets/to_hash.rb, line 306</span> + <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_h_flat</span> + <span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">to_h_flat</span> + <span class="ruby-keyword kw">end</span> +</pre> + </div> +</div> +</div> +<div class="method"> + <div class="title"> + <a name="M000474"></a><b>to_h_multi</b>() + </div> + <div class="description"> + <p> +This is equivalent to <a href="../Array.html#M000141">Array#to_h_multi</a>. +</p> + </div> +<div class="sourcecode"> + <p class="source-link">[ <a href="javascript:toggleSource('M000474_source')" id="l_M000474_source">+</a> ]</p> + <div id="M000474_source" class="dyn-source"> +<pre> +<span class="ruby-comment cmt"># File lib/core/facets/to_hash.rb, line 318</span> + <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_h_multi</span> + <span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">to_h_multi</span> + <span class="ruby-keyword kw">end</span> +</pre> + </div> +</div> +</div> +<div class="method"> + <div class="title"> + <a name="M000471"></a><b>to_h_splat</b>() + </div> + <div class="description"> + <p> +This is equivalent to <a href="../Array.html#M000138">Array#to_h_splat</a>. +</p> + </div> +<div class="sourcecode"> + <p class="source-link">[ <a href="javascript:toggleSource('M000471_source')" id="l_M000471_source">+</a> ]</p> + <div id="M000471_source" class="dyn-source"> +<pre> +<span class="ruby-comment cmt"># File lib/core/facets/to_hash.rb, line 300</span> + <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_h_splat</span> + <span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">to_h_splat</span> <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> \ No newline at end of file