doc/rdoc/core/classes/Kernel.html in facets-2.5.1 vs doc/rdoc/core/classes/Kernel.html in facets-2.5.2
- old
+ new
@@ -116,86 +116,86 @@
<div class="sectiontitle">Methods</div>
- <span style="padding-right: 5px;"><a href="#M000368">Bit</a></span>
- <span style="padding-right: 5px;"><a href="#M000408">__DIR__</a></span>
- <span style="padding-right: 5px;"><a href="#M000400">__HERE__</a></span>
- <span style="padding-right: 5px;"><a href="#M000369">as</a></span>
- <span style="padding-right: 5px;"><a href="#M000373">ask</a></span>
- <span style="padding-right: 5px;"><a href="#M000403">attr_singleton_accessor</a></span>
- <span style="padding-right: 5px;"><a href="#M000401">attr_singleton_reader</a></span>
- <span style="padding-right: 5px;"><a href="#M000402">attr_singleton_writer</a></span>
- <span style="padding-right: 5px;"><a href="#M000420">blank?</a></span>
- <span style="padding-right: 5px;"><a href="#M000367">bool?</a></span>
- <span style="padding-right: 5px;"><a href="#M000410">callstack</a></span>
- <span style="padding-right: 5px;"><a href="#M000381">complete</a></span>
- <span style="padding-right: 5px;"><a href="#M000414">constant</a></span>
- <span style="padding-right: 5px;"><a href="#M000398">d</a></span>
- <span style="padding-right: 5px;"><a href="#M000384">deep_copy</a></span>
- <span style="padding-right: 5px;"><a href="#M000362">demand</a></span>
- <span style="padding-right: 5px;"><a href="#M000374">demo</a></span>
- <span style="padding-right: 5px;"><a href="#M000360">eigenclass</a></span>
- <span style="padding-right: 5px;"><a href="#M000390">enable_warnings</a></span>
- <span style="padding-right: 5px;"><a href="#M000380">ergo</a></span>
- <span style="padding-right: 5px;"><a href="#M000366">false?</a></span>
- <span style="padding-right: 5px;"><a href="#M000363">future</a></span>
- <span style="padding-right: 5px;"><a href="#M000419">in?</a></span>
- <span style="padding-right: 5px;"><a href="#M000378">instance</a></span>
- <span style="padding-right: 5px;"><a href="#M000396">instance_assign</a></span>
- <span style="padding-right: 5px;"><a href="#M000399">instance_class</a></span>
- <span style="padding-right: 5px;"><a href="#M000395">instance_values</a></span>
- <span style="padding-right: 5px;"><a href="#M000394">instance_vars</a></span>
- <span style="padding-right: 5px;"><a href="#M000416">load_local</a></span>
- <span style="padding-right: 5px;"><a href="#M000375">maybe</a></span>
- <span style="padding-right: 5px;"><a href="#M000355">meta_alias</a></span>
- <span style="padding-right: 5px;"><a href="#M000358">meta_class</a></span>
- <span style="padding-right: 5px;"><a href="#M000357">meta_def</a></span>
- <span style="padding-right: 5px;"><a href="#M000356">meta_eval</a></span>
- <span style="padding-right: 5px;"><a href="#M000359">metaclass</a></span>
- <span style="padding-right: 5px;"><a href="#M000383">non_nil?</a></span>
- <span style="padding-right: 5px;"><a href="#M000382">not_nil?</a></span>
- <span style="padding-right: 5px;"><a href="#M000376">object_hexid</a></span>
- <span style="padding-right: 5px;"><a href="#M000379">object_send</a></span>
- <span style="padding-right: 5px;"><a href="#M000404">p</a></span>
- <span style="padding-right: 5px;"><a href="#M000411">populate</a></span>
- <span style="padding-right: 5px;"><a href="#M000361">promise</a></span>
- <span style="padding-right: 5px;"><a href="#M000392">qua_class</a></span>
- <span style="padding-right: 5px;"><a href="#M000391">require_all</a></span>
- <span style="padding-right: 5px;"><a href="#M000415">require_local</a></span>
- <span style="padding-right: 5px;"><a href="#M000393">resc</a></span>
- <span style="padding-right: 5px;"><a href="#M000417">respond</a></span>
- <span style="padding-right: 5px;"><a href="#M000418">respond_with_value</a></span>
- <span style="padding-right: 5px;"><a href="#M000409">returning</a></span>
- <span style="padding-right: 5px;"><a href="#M000370">send_as</a></span>
- <span style="padding-right: 5px;"><a href="#M000412">set_from</a></span>
- <span style="padding-right: 5px;"><a href="#M000386">silence_stderr</a></span>
- <span style="padding-right: 5px;"><a href="#M000387">silence_stdout</a></span>
- <span style="padding-right: 5px;"><a href="#M000385">silence_stream</a></span>
- <span style="padding-right: 5px;"><a href="#M000389">silence_warnings</a></span>
- <span style="padding-right: 5px;"><a href="#M000388">silently</a></span>
- <span style="padding-right: 5px;"><a href="#M000406">singleton</a></span>
- <span style="padding-right: 5px;"><a href="#M000405">singleton_class</a></span>
- <span style="padding-right: 5px;"><a href="#M000372">super_as</a></span>
- <span style="padding-right: 5px;"><a href="#M000371">super_method</a></span>
- <span style="padding-right: 5px;"><a href="#M000377">tap</a></span>
- <span style="padding-right: 5px;"><a href="#M000364">to_b</a></span>
- <span style="padding-right: 5px;"><a href="#M000365">true?</a></span>
- <span style="padding-right: 5px;"><a href="#M000407">try</a></span>
- <span style="padding-right: 5px;"><a href="#M000413">val?</a></span>
- <span style="padding-right: 5px;"><a href="#M000397">with</a></span>
+ <span style="padding-right: 5px;"><a href="#M000374">Bit</a></span>
+ <span style="padding-right: 5px;"><a href="#M000414">__DIR__</a></span>
+ <span style="padding-right: 5px;"><a href="#M000406">__HERE__</a></span>
+ <span style="padding-right: 5px;"><a href="#M000375">as</a></span>
+ <span style="padding-right: 5px;"><a href="#M000379">ask</a></span>
+ <span style="padding-right: 5px;"><a href="#M000409">attr_singleton_accessor</a></span>
+ <span style="padding-right: 5px;"><a href="#M000407">attr_singleton_reader</a></span>
+ <span style="padding-right: 5px;"><a href="#M000408">attr_singleton_writer</a></span>
+ <span style="padding-right: 5px;"><a href="#M000426">blank?</a></span>
+ <span style="padding-right: 5px;"><a href="#M000373">bool?</a></span>
+ <span style="padding-right: 5px;"><a href="#M000416">callstack</a></span>
+ <span style="padding-right: 5px;"><a href="#M000387">complete</a></span>
+ <span style="padding-right: 5px;"><a href="#M000420">constant</a></span>
+ <span style="padding-right: 5px;"><a href="#M000404">d</a></span>
+ <span style="padding-right: 5px;"><a href="#M000390">deep_copy</a></span>
+ <span style="padding-right: 5px;"><a href="#M000368">demand</a></span>
+ <span style="padding-right: 5px;"><a href="#M000380">demo</a></span>
+ <span style="padding-right: 5px;"><a href="#M000366">eigenclass</a></span>
+ <span style="padding-right: 5px;"><a href="#M000396">enable_warnings</a></span>
+ <span style="padding-right: 5px;"><a href="#M000386">ergo</a></span>
+ <span style="padding-right: 5px;"><a href="#M000372">false?</a></span>
+ <span style="padding-right: 5px;"><a href="#M000369">future</a></span>
+ <span style="padding-right: 5px;"><a href="#M000425">in?</a></span>
+ <span style="padding-right: 5px;"><a href="#M000384">instance</a></span>
+ <span style="padding-right: 5px;"><a href="#M000402">instance_assign</a></span>
+ <span style="padding-right: 5px;"><a href="#M000405">instance_class</a></span>
+ <span style="padding-right: 5px;"><a href="#M000401">instance_values</a></span>
+ <span style="padding-right: 5px;"><a href="#M000400">instance_vars</a></span>
+ <span style="padding-right: 5px;"><a href="#M000422">load_local</a></span>
+ <span style="padding-right: 5px;"><a href="#M000381">maybe</a></span>
+ <span style="padding-right: 5px;"><a href="#M000361">meta_alias</a></span>
+ <span style="padding-right: 5px;"><a href="#M000364">meta_class</a></span>
+ <span style="padding-right: 5px;"><a href="#M000363">meta_def</a></span>
+ <span style="padding-right: 5px;"><a href="#M000362">meta_eval</a></span>
+ <span style="padding-right: 5px;"><a href="#M000365">metaclass</a></span>
+ <span style="padding-right: 5px;"><a href="#M000389">non_nil?</a></span>
+ <span style="padding-right: 5px;"><a href="#M000388">not_nil?</a></span>
+ <span style="padding-right: 5px;"><a href="#M000382">object_hexid</a></span>
+ <span style="padding-right: 5px;"><a href="#M000385">object_send</a></span>
+ <span style="padding-right: 5px;"><a href="#M000410">p</a></span>
+ <span style="padding-right: 5px;"><a href="#M000417">populate</a></span>
+ <span style="padding-right: 5px;"><a href="#M000367">promise</a></span>
+ <span style="padding-right: 5px;"><a href="#M000398">qua_class</a></span>
+ <span style="padding-right: 5px;"><a href="#M000397">require_all</a></span>
+ <span style="padding-right: 5px;"><a href="#M000421">require_local</a></span>
+ <span style="padding-right: 5px;"><a href="#M000399">resc</a></span>
+ <span style="padding-right: 5px;"><a href="#M000423">respond</a></span>
+ <span style="padding-right: 5px;"><a href="#M000424">respond_with_value</a></span>
+ <span style="padding-right: 5px;"><a href="#M000415">returning</a></span>
+ <span style="padding-right: 5px;"><a href="#M000376">send_as</a></span>
+ <span style="padding-right: 5px;"><a href="#M000418">set_from</a></span>
+ <span style="padding-right: 5px;"><a href="#M000392">silence_stderr</a></span>
+ <span style="padding-right: 5px;"><a href="#M000393">silence_stdout</a></span>
+ <span style="padding-right: 5px;"><a href="#M000391">silence_stream</a></span>
+ <span style="padding-right: 5px;"><a href="#M000395">silence_warnings</a></span>
+ <span style="padding-right: 5px;"><a href="#M000394">silently</a></span>
+ <span style="padding-right: 5px;"><a href="#M000412">singleton</a></span>
+ <span style="padding-right: 5px;"><a href="#M000411">singleton_class</a></span>
+ <span style="padding-right: 5px;"><a href="#M000378">super_as</a></span>
+ <span style="padding-right: 5px;"><a href="#M000377">super_method</a></span>
+ <span style="padding-right: 5px;"><a href="#M000383">tap</a></span>
+ <span style="padding-right: 5px;"><a href="#M000370">to_b</a></span>
+ <span style="padding-right: 5px;"><a href="#M000371">true?</a></span>
+ <span style="padding-right: 5px;"><a href="#M000413">try</a></span>
+ <span style="padding-right: 5px;"><a href="#M000419">val?</a></span>
+ <span style="padding-right: 5px;"><a href="#M000403">with</a></span>
<div class="sectiontitle">Public Instance methods</div>
<div class="method">
<div class="title">
- <a name="M000368"></a><b>Bit</b>(n)
+ <a name="M000374"></a><b>Bit</b>(n)
</div>
<div class="description">
<p>
Create a single bit bitmask.
</p>
@@ -210,12 +210,12 @@
<p>
CREDIT: Thomas Sawyer, George Moschovitis
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000368_source')" id="l_M000368_source">+</a> ]</p>
- <div id="M000368_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000374_source')" id="l_M000374_source">+</a> ]</p>
+ <div id="M000374_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/bitmask.rb, line 97</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Bit</span>(<span class="ruby-identifier">n</span>)
<span class="ruby-value">1</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">Integer</span>(<span class="ruby-identifier">n</span>)
<span class="ruby-keyword kw">end</span>
@@ -223,11 +223,11 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000408"></a><b>__DIR__</b>()
+ <a name="M000414"></a><b>__DIR__</b>()
</div>
<div class="description">
<p>
Similar to <em>FILE</em> and <em>LINE</em>, <em>DIR</em> provides the
directory path to the current executing script.
@@ -235,12 +235,12 @@
<p>
CREDIT: Trans
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000408_source')" id="l_M000408_source">+</a> ]</p>
- <div id="M000408_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000414_source')" id="l_M000414_source">+</a> ]</p>
+ <div id="M000414_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/__dir__.rb, line 8</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">__DIR__</span>
(<span class="ruby-regexp re">/^(.+)?:\d+/</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">caller</span>[<span class="ruby-value">0</span>]) <span class="ruby-operator">?</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">$1</span>) <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
<span class="ruby-keyword kw">end</span>
@@ -248,15 +248,15 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000400"></a><b>__HERE__</b>()
+ <a name="M000406"></a><b>__HERE__</b>()
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000400_source')" id="l_M000400_source">+</a> ]</p>
- <div id="M000400_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000406_source')" id="l_M000406_source">+</a> ]</p>
+ <div id="M000406_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/__here__.rb, line 3</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">__HERE__</span>
<span class="ruby-node">"#{__FILE__}: #{__LINE__}"</span>
<span class="ruby-keyword kw">end</span>
@@ -264,11 +264,11 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000369"></a><b>as</b>(ancestor, &blk)
+ <a name="M000375"></a><b>as</b>(ancestor, &blk)
</div>
<div class="description">
<p>
Returns a As-functor that allows one to call any ancestor‘s method
directly of the given object.
@@ -288,12 +288,12 @@
C.new.x #=> 1
</pre>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000369_source')" id="l_M000369_source">+</a> ]</p>
- <div id="M000369_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000375_source')" id="l_M000375_source">+</a> ]</p>
+ <div id="M000375_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/as.rb, line 22</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">as</span>(<span class="ruby-identifier">ancestor</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">blk</span>)
<span class="ruby-ivar">@__as</span> <span class="ruby-operator">||=</span> {}
<span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">r</span> = <span class="ruby-ivar">@__as</span>[<span class="ruby-identifier">ancestor</span>]
@@ -307,11 +307,11 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000373"></a><b>ask</b>(question, answers=nil)
+ <a name="M000379"></a><b>ask</b>(question, answers=nil)
</div>
<div class="description">
<p>
Very simple convenience method to get a console reply.
</p>
@@ -329,17 +329,17 @@
</p>
<pre>
$ Are you happy? [Yn] Y <ENTER>
</pre>
<p>
-The <a href="Kernel.html#M000373">ask</a> method would return
+The <a href="Kernel.html#M000379">ask</a> method would return
"Y".
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000373_source')" id="l_M000373_source">+</a> ]</p>
- <div id="M000373_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000379_source')" id="l_M000379_source">+</a> ]</p>
+ <div id="M000379_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/ask.rb, line 19</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ask</span>(<span class="ruby-identifier">question</span>, <span class="ruby-identifier">answers</span>=<span class="ruby-keyword kw">nil</span>)
<span class="ruby-identifier">$stdout</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{question}"</span>
<span class="ruby-identifier">$stdout</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" [#{answers}] "</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">answers</span>
@@ -350,16 +350,16 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000403"></a><b>attr_singleton_accessor</b>(*args)
+ <a name="M000409"></a><b>attr_singleton_accessor</b>(*args)
</div>
<div class="description">
<p>
-Takes an array or hash <a href="Kernel.html#M000397">with</a> default
-values and creates <a href="Kernel.html#M000406">singleton</a>
+Takes an array or hash <a href="Kernel.html#M000403">with</a> default
+values and creates <a href="Kernel.html#M000412">singleton</a>
attr_accessors for each.
</p>
<pre>
attr_singleton_accessor { :x => 1, :y => 2 }
@x #=> 1
@@ -372,12 +372,12 @@
<p>
CREDIT: Trans
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000403_source')" id="l_M000403_source">+</a> ]</p>
- <div id="M000403_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000409_source')" id="l_M000409_source">+</a> ]</p>
+ <div id="M000409_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/attr_singleton.rb, line 54</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">attr_singleton_accessor</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
<span class="ruby-comment cmt">#h, a = *args.partition{|a| Hash===a}</span>
(<span class="ruby-keyword kw">class</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span> ; <span class="ruby-keyword kw">self</span> ; <span class="ruby-keyword kw">end</span>).<span class="ruby-identifier">send</span>( <span class="ruby-identifier">:attr_accessor</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span> )
@@ -388,16 +388,16 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000401"></a><b>attr_singleton_reader</b>(*args)
+ <a name="M000407"></a><b>attr_singleton_reader</b>(*args)
</div>
<div class="description">
<p>
-Takes an array or a hash <a href="Kernel.html#M000397">with</a> default
-values and creates <a href="Kernel.html#M000406">singleton</a> attr_readers
+Takes an array or a hash <a href="Kernel.html#M000403">with</a> default
+values and creates <a href="Kernel.html#M000412">singleton</a> attr_readers
for each.
</p>
<pre>
attr_singleton_reader {:x => 1, :y => 2}
@x #=> 1
@@ -408,12 +408,12 @@
<p>
CREDIT: Trans
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000401_source')" id="l_M000401_source">+</a> ]</p>
- <div id="M000401_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000407_source')" id="l_M000407_source">+</a> ]</p>
+ <div id="M000407_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/attr_singleton.rb, line 14</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">attr_singleton_reader</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
<span class="ruby-comment cmt">#h, a = *args.partition{|a| Hash===a}</span>
(<span class="ruby-keyword kw">class</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span> ; <span class="ruby-keyword kw">self</span> ; <span class="ruby-keyword kw">end</span>).<span class="ruby-identifier">send</span>( <span class="ruby-identifier">:attr_reader</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span> )
@@ -424,16 +424,16 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000402"></a><b>attr_singleton_writer</b>(*args)
+ <a name="M000408"></a><b>attr_singleton_writer</b>(*args)
</div>
<div class="description">
<p>
-Takes an array or a hash <a href="Kernel.html#M000397">with</a> default
-values and creates <a href="Kernel.html#M000406">singleton</a> attr_writers
+Takes an array or a hash <a href="Kernel.html#M000403">with</a> default
+values and creates <a href="Kernel.html#M000412">singleton</a> attr_writers
for each.
</p>
<pre>
attr_singleton_writer { :x => 1, :y => 2 }
@x #=> 1
@@ -446,12 +446,12 @@
<p>
CREDIT: Trans
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000402_source')" id="l_M000402_source">+</a> ]</p>
- <div id="M000402_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000408_source')" id="l_M000408_source">+</a> ]</p>
+ <div id="M000408_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/attr_singleton.rb, line 34</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">attr_singleton_writer</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
<span class="ruby-comment cmt">#h, a = *args.partition{|a| Hash===a}</span>
(<span class="ruby-keyword kw">class</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span> ; <span class="ruby-keyword kw">self</span> ; <span class="ruby-keyword kw">end</span>).<span class="ruby-identifier">send</span>( <span class="ruby-identifier">:attr_writer</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span> )
@@ -462,11 +462,11 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000420"></a><b>blank?</b>()
+ <a name="M000426"></a><b>blank?</b>()
</div>
<div class="description">
<p>
An object is blank if it‘s nil, empty, or a whitespace string. For
example, "", " ", nil, [], and {} are blank.
@@ -483,12 +483,12 @@
<pre>
if !address.blank?
</pre>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000420_source')" id="l_M000420_source">+</a> ]</p>
- <div id="M000420_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000426_source')" id="l_M000426_source">+</a> ]</p>
+ <div id="M000426_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/blank.rb, line 14</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">blank?</span>
<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:empty?</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">empty?</span> <span class="ruby-operator">:</span> <span class="ruby-operator">!</span><span class="ruby-keyword kw">self</span>
<span class="ruby-keyword kw">end</span>
@@ -496,11 +496,11 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000367"></a><b>bool?</b>()
+ <a name="M000373"></a><b>bool?</b>()
</div>
<div class="description">
<p>
Returns true is an object is class <a href="TrueClass.html">TrueClass</a>
or <a href="FalseClass.html">FalseClass</a>, otherwise false.
@@ -510,12 +510,12 @@
false.bool? #=> true
nil.bool? #=> false
</pre>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000367_source')" id="l_M000367_source">+</a> ]</p>
- <div id="M000367_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000373_source')" id="l_M000373_source">+</a> ]</p>
+ <div id="M000373_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/boolean.rb, line 127</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">bool?</span>
(<span class="ruby-keyword kw">true</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">self</span> <span class="ruby-keyword kw">or</span> <span class="ruby-keyword kw">false</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">self</span>)
<span class="ruby-keyword kw">end</span>
@@ -523,16 +523,16 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000410"></a><b>callstack</b>( level = 1 )
+ <a name="M000416"></a><b>callstack</b>( level = 1 )
</div>
<div class="description">
<p>
Parse a caller string and break it into its components, <a
-href="Kernel.html#M000409">returning</a> an array. Returns:
+href="Kernel.html#M000415">returning</a> an array. Returns:
</p>
<ul>
<li>file (<a href="String.html">String</a>)
</li>
@@ -567,12 +567,12 @@
<p>
CREDIT: Trans
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000410_source')" id="l_M000410_source">+</a> ]</p>
- <div id="M000410_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000416_source')" id="l_M000416_source">+</a> ]</p>
+ <div id="M000416_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/callstack.rb, line 27</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">callstack</span>( <span class="ruby-identifier">level</span> = <span class="ruby-value">1</span> )
<span class="ruby-identifier">call_str_array</span> = <span class="ruby-identifier">pp_callstack</span>(<span class="ruby-identifier">level</span>)
<span class="ruby-identifier">stack</span> = []
@@ -589,11 +589,11 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000381"></a><b>complete</b>() {|| ...}
+ <a name="M000387"></a><b>complete</b>() {|| ...}
</div>
<div class="description">
<p>
Repeat loop until it yeilds false or nil.
</p>
@@ -607,12 +607,12 @@
<p>
CREDIT: Trans
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000381_source')" id="l_M000381_source">+</a> ]</p>
- <div id="M000381_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000387_source')" id="l_M000387_source">+</a> ]</p>
+ <div id="M000387_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/complete.rb, line 13</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">complete</span>
<span class="ruby-identifier">loop</span> { <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">yield</span> }
<span class="ruby-keyword kw">end</span>
@@ -620,11 +620,11 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000414"></a><b>constant</b>(const)
+ <a name="M000420"></a><b>constant</b>(const)
</div>
<div class="description">
<p>
This is similar to +Module#const_get+ but is accessible at all levels, and,
unlike <tt>const_get</tt>, can handle module hierarchy.
@@ -643,12 +643,12 @@
<p>
CREDIT: Trans
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000414_source')" id="l_M000414_source">+</a> ]</p>
- <div id="M000414_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000420_source')" id="l_M000420_source">+</a> ]</p>
+ <div id="M000420_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/constant.rb, line 18</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">constant</span>(<span class="ruby-identifier">const</span>)
<span class="ruby-identifier">const</span> = <span class="ruby-identifier">const</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">dup</span>
<span class="ruby-identifier">base</span> = <span class="ruby-identifier">const</span>.<span class="ruby-identifier">sub!</span>(<span class="ruby-regexp re">/^::/</span>, <span class="ruby-value str">''</span>) <span class="ruby-operator">?</span> <span class="ruby-constant">Object</span> <span class="ruby-operator">:</span> ( <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Module</span>) <span class="ruby-operator">?</span> <span class="ruby-keyword kw">self</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span> )
@@ -658,15 +658,15 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000398"></a><b>d</b>(*x)
+ <a name="M000404"></a><b>d</b>(*x)
</div>
<div class="description">
<p>
-Like <a href="Kernel.html#M000404">p</a> but gives file and line number.
+Like <a href="Kernel.html#M000410">p</a> but gives file and line number.
</p>
<pre>
d("hi")
</pre>
<p>
@@ -680,12 +680,12 @@
TODO: This is borderline "prime". Keep here? Another copy of it
exits in dtools.rb
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000398_source')" id="l_M000398_source">+</a> ]</p>
- <div id="M000398_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000404_source')" id="l_M000404_source">+</a> ]</p>
+ <div id="M000404_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/d.rb, line 15</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">d</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">x</span>)
<span class="ruby-identifier">puts</span> <span class="ruby-node">"#{__FILE__}, #{__LINE__}"</span>
<span class="ruby-identifier">x</span>.<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">puts</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">inspect</span> } <span class="ruby-comment cmt">#p(*x)</span>
@@ -695,24 +695,24 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000384"></a><b>deep_copy</b>()
+ <a name="M000390"></a><b>deep_copy</b>()
</div>
<div class="description">
<p>
Anything that can be marshaled can be copied in totality. This is also
-commonly called a <a href="Kernel.html#M000384">deep_copy</a>.
+commonly called a <a href="Kernel.html#M000390">deep_copy</a>.
</p>
<pre>
"ABC".copy #=> "ABC"
</pre>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000384_source')" id="l_M000384_source">+</a> ]</p>
- <div id="M000384_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000390_source')" id="l_M000390_source">+</a> ]</p>
+ <div id="M000390_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/deep_copy.rb, line 8</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">deep_copy</span>
<span class="ruby-constant">Marshal</span><span class="ruby-operator">::</span><span class="ruby-identifier">load</span>(<span class="ruby-constant">Marshal</span><span class="ruby-operator">::</span><span class="ruby-identifier">dump</span>(<span class="ruby-keyword kw">self</span>))
<span class="ruby-keyword kw">end</span>
@@ -720,28 +720,28 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000362"></a><b>demand</b>( promise )
+ <a name="M000368"></a><b>demand</b>( promise )
</div>
<div class="description">
<p>
-Forces the result of a <a href="Kernel.html#M000361">promise</a> to be
+Forces the result of a <a href="Kernel.html#M000367">promise</a> to be
computed (if necessary) and returns the bare result object. Once evaluated,
-the result of the <a href="Kernel.html#M000361">promise</a> will be cached.
+the result of the <a href="Kernel.html#M000367">promise</a> will be cached.
Nested promises will be evaluated together, until the first non-<a
-href="Kernel.html#M000361">promise</a> result.
+href="Kernel.html#M000367">promise</a> result.
</p>
<p>
If called on a value that is not a <a
-href="Kernel.html#M000361">promise</a>, it will simply return it.
+href="Kernel.html#M000367">promise</a>, it will simply return it.
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000362_source')" id="l_M000362_source">+</a> ]</p>
- <div id="M000362_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000368_source')" id="l_M000368_source">+</a> ]</p>
+ <div id="M000368_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/lazy.rb, line 219</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">demand</span>( <span class="ruby-identifier">promise</span> )
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">promise</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-identifier">:__result__</span>
<span class="ruby-identifier">promise</span>.<span class="ruby-identifier">__result__</span>
@@ -753,11 +753,11 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000374"></a><b>demo</b>(out=$stdout,&block)
+ <a name="M000380"></a><b>demo</b>(out=$stdout,&block)
</div>
<div class="description">
<p>
For debugging and showing examples. Currently this takes an argument of a
string in a block.
@@ -779,12 +779,12 @@
TODO: Is there a way to do this without the eval string in block?
Preferably just a block and no string.
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000374_source')" id="l_M000374_source">+</a> ]</p>
- <div id="M000374_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000380_source')" id="l_M000380_source">+</a> ]</p>
+ <div id="M000380_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/demo.rb, line 19</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">demo</span>(<span class="ruby-identifier">out</span>=<span class="ruby-identifier">$stdout</span>,<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
<span class="ruby-identifier">out</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">sprintf</span>(<span class="ruby-value str">"%-25s#=> %s\n"</span>, <span class="ruby-identifier">expr</span> = <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>, <span class="ruby-identifier">eval</span>(<span class="ruby-identifier">expr</span>, <span class="ruby-identifier">block</span>.<span class="ruby-identifier">binding</span>).<span class="ruby-identifier">inspect</span>)
<span class="ruby-keyword kw">end</span>
@@ -792,17 +792,17 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000360"></a><b>eigenclass</b>()
+ <a name="M000366"></a><b>eigenclass</b>()
</div>
<div class="description">
<p>
During this trying time when no one can get their techie catchwords to
stick to the refrigerator no matter how hard they slap it # <a
-href="Kernel.html#M000397">with</a> the enchanted magnetic spatula, it’s
+href="Kernel.html#M000403">with</a> the enchanted magnetic spatula, it’s
good to know that the contrived phrases really do fly, graceful and
unclasped and bearing north toward chilled shrimp. I know what my
Hallowe’en pumpkin is going to say.
</p>
<pre>
@@ -811,12 +811,12 @@
<p>
CREDIT: WhyTheLuckyStiff
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000360_source')" id="l_M000360_source">+</a> ]</p>
- <div id="M000360_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000366_source')" id="l_M000366_source">+</a> ]</p>
+ <div id="M000366_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/metaid.rb, line 69</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">eigenclass</span>
(<span class="ruby-keyword kw">class</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">end</span>)
<span class="ruby-keyword kw">end</span>
@@ -824,11 +824,11 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000390"></a><b>enable_warnings</b>() {|| ...}
+ <a name="M000396"></a><b>enable_warnings</b>() {|| ...}
</div>
<div class="description">
<p>
Sets $VERBOSE to true for the duration of the block and back to its
original value afterwards.
@@ -836,12 +836,12 @@
<p>
CREDIT: David Heinemeier Hansson
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000390_source')" id="l_M000390_source">+</a> ]</p>
- <div id="M000390_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000396_source')" id="l_M000396_source">+</a> ]</p>
+ <div id="M000396_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/silence.rb, line 67</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">enable_warnings</span>
<span class="ruby-identifier">old_verbose</span>, <span class="ruby-identifier">$VERBOSE</span> = <span class="ruby-identifier">$VERBOSE</span>, <span class="ruby-keyword kw">true</span>
<span class="ruby-keyword kw">yield</span>
@@ -852,11 +852,11 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000380"></a><b>ergo</b>() {|self| ...}
+ <a name="M000386"></a><b>ergo</b>() {|self| ...}
</div>
<div class="description">
<p>
Yield self -or- return self.
</p>
@@ -866,20 +866,20 @@
"a".ergo{ |o| o.upcase } #=> "A"
nil.ergo{ |o| o.foobar } #=> nil
</pre>
<p>
-This is like <a href="Kernel.html#M000377">tap</a>, but <a
-href="Kernel.html#M000377">tap</a> yields self -and- returns self.
+This is like <a href="Kernel.html#M000383">tap</a>, but <a
+href="Kernel.html#M000383">tap</a> yields self -and- returns self.
</p>
<p>
CREDIT: Daniel DeLorme
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000380_source')" id="l_M000380_source">+</a> ]</p>
- <div id="M000380_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000386_source')" id="l_M000386_source">+</a> ]</p>
+ <div id="M000386_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/ergo.rb, line 17</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ergo</span> <span class="ruby-operator">&</span><span class="ruby-identifier">b</span>
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
<span class="ruby-identifier">b</span>.<span class="ruby-identifier">arity</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">yield</span>(<span class="ruby-keyword kw">self</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">instance_eval</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">b</span>)
@@ -891,11 +891,11 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000366"></a><b>false?</b>()
+ <a name="M000372"></a><b>false?</b>()
</div>
<div class="description">
<p>
Returns true is an object is class <a
href="FalseClass.html">FalseClass</a>, otherwise false.
@@ -905,12 +905,12 @@
false.false? #=> true
nil.false? #=> false
</pre>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000366_source')" id="l_M000366_source">+</a> ]</p>
- <div id="M000366_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000372_source')" id="l_M000372_source">+</a> ]</p>
+ <div id="M000372_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/boolean.rb, line 116</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">false?</span>
(<span class="ruby-keyword kw">false</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">self</span>)
<span class="ruby-keyword kw">end</span>
@@ -918,29 +918,29 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000363"></a><b>future</b>( ) {|result| ...}
+ <a name="M000369"></a><b>future</b>( ) {|result| ...}
</div>
<div class="description">
<p>
Schedules a computation to be run asynchronously in a background thread and
-returns a <a href="Kernel.html#M000361">promise</a> for its result. An
-attempt to <a href="Kernel.html#M000362">demand</a> the result of the <a
-href="Kernel.html#M000361">promise</a> will block until the computation
+returns a <a href="Kernel.html#M000367">promise</a> for its result. An
+attempt to <a href="Kernel.html#M000368">demand</a> the result of the <a
+href="Kernel.html#M000367">promise</a> will block until the computation
finishes.
</p>
<p>
-As <a href="Kernel.html#M000397">with</a> <a
-href="Kernel.html#M000361">Kernel.promise</a>, this passes the block a <a
-href="Kernel.html#M000361">promise</a> for its own result. Use wisely.
+As <a href="Kernel.html#M000403">with</a> <a
+href="Kernel.html#M000367">Kernel.promise</a>, this passes the block a <a
+href="Kernel.html#M000367">promise</a> for its own result. Use wisely.
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000363_source')" id="l_M000363_source">+</a> ]</p>
- <div id="M000363_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000369_source')" id="l_M000369_source">+</a> ]</p>
+ <div id="M000369_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/lazy.rb, line 234</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">future</span>( <span class="ruby-operator">&</span><span class="ruby-identifier">computation</span> ) <span class="ruby-comment cmt">#:yields: result</span>
<span class="ruby-constant">Lazy</span><span class="ruby-operator">::</span><span class="ruby-constant">Future</span>.<span class="ruby-identifier">new</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">computation</span>)
<span class="ruby-keyword kw">end</span>
@@ -948,11 +948,11 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000419"></a><b>in?</b>(other)
+ <a name="M000425"></a><b>in?</b>(other)
</div>
<div class="description">
<p>
Is self included in other?
</p>
@@ -960,12 +960,12 @@
5.in?(0..10) #=> true
5.in?([0,1,2,3]) #=> false
</pre>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000419_source')" id="l_M000419_source">+</a> ]</p>
- <div id="M000419_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000425_source')" id="l_M000425_source">+</a> ]</p>
+ <div id="M000425_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/in.rb, line 8</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">in?</span>(<span class="ruby-identifier">other</span>)
<span class="ruby-identifier">other</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-keyword kw">self</span>)
<span class="ruby-keyword kw">end</span>
@@ -973,26 +973,26 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000378"></a><b>instance</b>()
+ <a name="M000384"></a><b>instance</b>()
</div>
<div class="description">
<p>
-Access internals of an object <a href="Kernel.html#M000369">as</a> if <a
-href="Kernel.html#M000397">with</a> private access.
+Access internals of an object <a href="Kernel.html#M000375">as</a> if <a
+href="Kernel.html#M000403">with</a> private access.
</p>
<pre>
class X
metaclass.instance.attr_reader :x
end
</pre>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000378_source')" id="l_M000378_source">+</a> ]</p>
- <div id="M000378_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000384_source')" id="l_M000384_source">+</a> ]</p>
+ <div id="M000384_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/instance.rb, line 12</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">instance</span>
<span class="ruby-ivar">@_instance_functor</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Functor</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">op</span>,<span class="ruby-operator">*</span><span class="ruby-identifier">args</span><span class="ruby-operator">|</span>
<span class="ruby-identifier">send</span>(<span class="ruby-identifier">op</span>,<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
@@ -1002,29 +1002,29 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000396"></a><b>instance_assign</b>(hash)
+ <a name="M000402"></a><b>instance_assign</b>(hash)
</div>
<div class="description">
<p>
-Set <a href="Kernel.html#M000378">instance</a> variables using a hash.
+Set <a href="Kernel.html#M000384">instance</a> variables using a hash.
</p>
<pre>
instance_assign('@a'=>1, '@b'=>2)
@a #=> 1
@b #=> 2
</pre>
<p>
-WARNING: <a href="Kernel.html#M000396">instance_assign</a> will be
+WARNING: <a href="Kernel.html#M000402">instance_assign</a> will be
deprecated. Use instance_vars.update instead.
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000396_source')" id="l_M000396_source">+</a> ]</p>
- <div id="M000396_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000402_source')" id="l_M000402_source">+</a> ]</p>
+ <div id="M000402_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/instance_assign.rb, line 32</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">instance_assign</span>(<span class="ruby-identifier">hash</span>)
<span class="ruby-identifier">hash</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
<span class="ruby-identifier">k</span> = <span class="ruby-node">"@#{k}"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">k</span> <span class="ruby-operator">!~</span> <span class="ruby-regexp re">/^@/</span>
@@ -1036,30 +1036,30 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000399"></a><b>instance_class</b>(&block)
+ <a name="M000405"></a><b>instance_class</b>(&block)
</div>
<div class="description">
<p>
Easy access to an object qua class, otherwise known <a
-href="Kernel.html#M000369">as</a> the object‘s <a
-href="Kernel.html#M000359">metaclass</a> or <a
-href="Kernel.html#M000406">singleton</a> class. This implemnetation alwasy
+href="Kernel.html#M000375">as</a> the object‘s <a
+href="Kernel.html#M000365">metaclass</a> or <a
+href="Kernel.html#M000412">singleton</a> class. This implemnetation alwasy
returns the class, even if a block is provided to eval against it.
</p>
<pre>
It is what it is.
</pre>
<p>
CREDIT: Trans
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000399_source')" id="l_M000399_source">+</a> ]</p>
- <div id="M000399_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000405_source')" id="l_M000405_source">+</a> ]</p>
+ <div id="M000405_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/instance_class.rb, line 19</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">instance_class</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
(<span class="ruby-keyword kw">class</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">end</span>).<span class="ruby-identifier">module_eval</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block</span>
(<span class="ruby-keyword kw">class</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">end</span>)
@@ -1068,15 +1068,15 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000395"></a><b>instance_values</b>()
+ <a name="M000401"></a><b>instance_values</b>()
</div>
<div class="description">
<p>
-Return <a href="Kernel.html#M000378">instance</a> variable values in an
+Return <a href="Kernel.html#M000384">instance</a> variable values in an
array.
</p>
<pre>
class X
def initialize(a,b)
@@ -1087,17 +1087,17 @@
x = X.new(1,2)
x.instance_values #=> { "a"=>1, "b"=>2 }
</pre>
<p>
-WARNING: <a href="Kernel.html#M000395">instance_values</a> will be
+WARNING: <a href="Kernel.html#M000401">instance_values</a> will be
deprecated. Use instance_vars.to_hash instead.
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000395_source')" id="l_M000395_source">+</a> ]</p>
- <div id="M000395_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000401_source')" id="l_M000401_source">+</a> ]</p>
+ <div id="M000401_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/instance_assign.rb, line 17</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">instance_values</span>
<span class="ruby-identifier">instance_variables</span>.<span class="ruby-identifier">inject</span>({}) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">values</span>, <span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
<span class="ruby-identifier">values</span>[<span class="ruby-identifier">name</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>]] = <span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-identifier">name</span>)
@@ -1108,15 +1108,15 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000394"></a><b>instance_vars</b>()
+ <a name="M000400"></a><b>instance_vars</b>()
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000394_source')" id="l_M000394_source">+</a> ]</p>
- <div id="M000394_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000400_source')" id="l_M000400_source">+</a> ]</p>
+ <div id="M000400_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/instance_variables.rb, line 3</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">instance_vars</span>
<span class="ruby-constant">InstanceVariables</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>)
<span class="ruby-keyword kw">end</span>
@@ -1124,24 +1124,24 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000416"></a><b>load_local</b>(fname, safe=nil)
+ <a name="M000422"></a><b>load_local</b>(fname, safe=nil)
</div>
<div class="description">
<p>
-Load file from same dir <a href="Kernel.html#M000369">as</a> calling
+Load file from same dir <a href="Kernel.html#M000375">as</a> calling
script.
</p>
<pre>
load_local 'templib'
</pre>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000416_source')" id="l_M000416_source">+</a> ]</p>
- <div id="M000416_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000422_source')" id="l_M000422_source">+</a> ]</p>
+ <div id="M000422_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/require_local.rb, line 17</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_local</span>(<span class="ruby-identifier">fname</span>, <span class="ruby-identifier">safe</span>=<span class="ruby-keyword kw">nil</span>)
<span class="ruby-comment cmt">#fdir = File.expand_path( File.dirname( caller[0] ) )</span>
<span class="ruby-identifier">fdir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>( <span class="ruby-identifier">caller</span>[<span class="ruby-value">0</span>] )
@@ -1151,11 +1151,11 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000375"></a><b>maybe</b>(chance = 0.5) {|if rand < chance| ...}
+ <a name="M000381"></a><b>maybe</b>(chance = 0.5) {|if rand < chance| ...}
</div>
<div class="description">
<p>
Random generator that returns true or false. Can also take a block that has
a 50/50 chance to being executed.
@@ -1164,12 +1164,12 @@
maybe #=> true
maybe #=> false
</pre>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000375_source')" id="l_M000375_source">+</a> ]</p>
- <div id="M000375_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000381_source')" id="l_M000381_source">+</a> ]</p>
+ <div id="M000381_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/maybe.rb, line 9</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">maybe</span>(<span class="ruby-identifier">chance</span> = <span class="ruby-value">0</span><span class="ruby-value">.5</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block</span> <span class="ruby-keyword kw">then</span>
<span class="ruby-keyword kw">yield</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">rand</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">chance</span>
@@ -1181,16 +1181,16 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000355"></a><b>meta_alias</b>(*args)
+ <a name="M000361"></a><b>meta_alias</b>(*args)
</div>
<div class="description">
<p>
-Alias a method defined in the <a href="Kernel.html#M000359">metaclass</a>
-(ie. <a href="Kernel.html#M000406">singleton</a> class).
+Alias a method defined in the <a href="Kernel.html#M000365">metaclass</a>
+(ie. <a href="Kernel.html#M000412">singleton</a> class).
</p>
<pre>
def X.y?; "y?" ; end
X.meta_alias "ynot?", "y?"
X.ynot? #=> y?
@@ -1198,12 +1198,12 @@
<p>
CREDIT: Trans
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000355_source')" id="l_M000355_source">+</a> ]</p>
- <div id="M000355_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000361_source')" id="l_M000361_source">+</a> ]</p>
+ <div id="M000361_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/metaid.rb, line 11</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">meta_alias</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
<span class="ruby-identifier">meta_class</span> <span class="ruby-keyword kw">do</span>
<span class="ruby-identifier">alias_method</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
@@ -1213,27 +1213,27 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000358"></a><b>meta_class</b>(&block)
+ <a name="M000364"></a><b>meta_class</b>(&block)
</div>
<div class="description">
<p>
Easy access to an object‘s "special" class, otherwise known
-<a href="Kernel.html#M000369">as</a> it‘s <a
-href="Kernel.html#M000359">metaclass</a> or <a
-href="Kernel.html#M000406">singleton</a> class.
+<a href="Kernel.html#M000375">as</a> it‘s <a
+href="Kernel.html#M000365">metaclass</a> or <a
+href="Kernel.html#M000412">singleton</a> class.
</p>
</div>
<div class="aka">
This method is also aliased as
- <a href="Kernel.html#M000359">metaclass</a>
+ <a href="Kernel.html#M000365">metaclass</a>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000358_source')" id="l_M000358_source">+</a> ]</p>
- <div id="M000358_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000364_source')" id="l_M000364_source">+</a> ]</p>
+ <div id="M000364_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/metaid.rb, line 47</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">meta_class</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
(<span class="ruby-keyword kw">class</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">end</span>).<span class="ruby-identifier">class_eval</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
@@ -1245,16 +1245,16 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000357"></a><b>meta_def</b>( name, &block )
+ <a name="M000363"></a><b>meta_def</b>( name, &block )
</div>
<div class="description">
<p>
Add method to a meta-class —i.e. a <a
-href="Kernel.html#M000406">singleton</a> method.
+href="Kernel.html#M000412">singleton</a> method.
</p>
<pre>
class X; end
X.meta_def(:x){"x"}
X.x #=> "x"
@@ -1262,12 +1262,12 @@
<p>
CREDIT: WhyTheLuckyStiff
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000357_source')" id="l_M000357_source">+</a> ]</p>
- <div id="M000357_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000363_source')" id="l_M000363_source">+</a> ]</p>
+ <div id="M000363_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/metaid.rb, line 38</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">meta_def</span>( <span class="ruby-identifier">name</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span> )
<span class="ruby-identifier">meta_class</span> <span class="ruby-keyword kw">do</span>
<span class="ruby-identifier">define_method</span>( <span class="ruby-identifier">name</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span> )
@@ -1277,24 +1277,24 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000356"></a><b>meta_eval</b>(str=nil, &blk)
+ <a name="M000362"></a><b>meta_eval</b>(str=nil, &blk)
</div>
<div class="description">
<p>
-Evaluate code in a <a href="Kernel.html#M000359">metaclass</a>. This is
+Evaluate code in a <a href="Kernel.html#M000365">metaclass</a>. This is
equivalent to ‘meta_class.instance_eval’.
</p>
<p>
CREDIT: WhyTheLuckyStiff
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000356_source')" id="l_M000356_source">+</a> ]</p>
- <div id="M000356_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000362_source')" id="l_M000362_source">+</a> ]</p>
+ <div id="M000362_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/metaid.rb, line 22</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">meta_eval</span>(<span class="ruby-identifier">str</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">blk</span>)
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">str</span>
<span class="ruby-identifier">meta_class</span>.<span class="ruby-identifier">instance_eval</span>(<span class="ruby-identifier">str</span>)
@@ -1306,31 +1306,31 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000359"></a><b>metaclass</b>(&block)
+ <a name="M000365"></a><b>metaclass</b>(&block)
</div>
<div class="description">
<p>
-Alias for <a href="Kernel.html#M000358">meta_class</a>
+Alias for <a href="Kernel.html#M000364">meta_class</a>
</p>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000383"></a><b>non_nil?</b>()
+ <a name="M000389"></a><b>non_nil?</b>()
</div>
<div class="description">
<p>
Alias for not_nil?
</p>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000382"></a><b>not_nil?</b>()
+ <a name="M000388"></a><b>not_nil?</b>()
</div>
<div class="description">
<p>
The opposite of nil?.
</p>
@@ -1342,15 +1342,15 @@
CREDIT: Gavin Sinclair
</p>
</div>
<div class="aka">
This method is also aliased as
- <a href="Kernel.html#M000383">non_nil?</a>
+ <a href="Kernel.html#M000389">non_nil?</a>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000382_source')" id="l_M000382_source">+</a> ]</p>
- <div id="M000382_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000388_source')" id="l_M000388_source">+</a> ]</p>
+ <div id="M000388_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/not_nil.rb, line 10</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">not_nil?</span>
<span class="ruby-keyword kw">not</span> <span class="ruby-identifier">nil?</span>
<span class="ruby-keyword kw">end</span>
@@ -1358,25 +1358,25 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000376"></a><b>object_hexid</b>()
+ <a name="M000382"></a><b>object_hexid</b>()
</div>
<div class="description">
<p>
-Returns the object id <a href="Kernel.html#M000369">as</a> a string in
+Returns the object id <a href="Kernel.html#M000375">as</a> a string in
hexideciaml, which is how Ruby reports them <a
-href="Kernel.html#M000397">with</a> inspect.
+href="Kernel.html#M000403">with</a> inspect.
</p>
<pre>
"ABC".object_hexid #=> "0x402d359c"
</pre>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000376_source')" id="l_M000376_source">+</a> ]</p>
- <div id="M000376_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000382_source')" id="l_M000382_source">+</a> ]</p>
+ <div id="M000382_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/object_hexid.rb, line 8</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">object_hexid</span>
<span class="ruby-keyword kw">return</span> <span class="ruby-value str">"0x"</span> <span class="ruby-operator"><<</span> (<span class="ruby-value str">'%.x'</span> <span class="ruby-operator">%</span> (<span class="ruby-value">2</span><span class="ruby-operator">*</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">__id__</span>)) <span class="ruby-comment cmt">#[1..-1]</span>
<span class="ruby-keyword kw">end</span>
@@ -1384,11 +1384,11 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000379"></a><b>object_send</b>(name,*args,&blk)
+ <a name="M000385"></a><b>object_send</b>(name,*args,&blk)
</div>
<div class="description">
<p>
Send only to public methods.
</p>
@@ -1400,20 +1400,20 @@
X.new.object_send(:foo)
=> NoMethodError: private method `foo' called for #<X:0xb7ac6ba8>
</pre>
<p>
-TODO: <a href="Kernel.html#M000379">object_send</a> needs to change for
+TODO: <a href="Kernel.html#M000385">object_send</a> needs to change for
1.9.
</p>
<p>
CREDIT: Trans
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000379_source')" id="l_M000379_source">+</a> ]</p>
- <div id="M000379_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000385_source')" id="l_M000385_source">+</a> ]</p>
+ <div id="M000385_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/object_send.rb, line 20</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">object_send</span>(<span class="ruby-identifier">name</span>,<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>,<span class="ruby-operator">&</span><span class="ruby-identifier">blk</span>)
<span class="ruby-comment cmt">#instance_eval "self.#{name}(*args)"</span>
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">name</span>)
@@ -1428,15 +1428,15 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000404"></a><b>p</b>(*x)
+ <a name="M000410"></a><b>p</b>(*x)
</div>
<div class="description">
<p>
-Alternate to standard <a href="Kernel.html#M000404">p</a> method that
+Alternate to standard <a href="Kernel.html#M000410">p</a> method that
outputs Kernel#inspect to stdout, but also passes through the orginal
argument(s).
</p>
<pre>
x = 1
@@ -1449,17 +1449,17 @@
<pre>
1
5
</pre>
<p>
-TODO: DEPRECATE <a href="Kernel.html#M000369">as</a> of 1.9, <em>if</em> it
+TODO: DEPRECATE <a href="Kernel.html#M000375">as</a> of 1.9, <em>if</em> it
will do this.
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000404_source')" id="l_M000404_source">+</a> ]</p>
- <div id="M000404_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000410_source')" id="l_M000410_source">+</a> ]</p>
+ <div id="M000410_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/p.rb, line 18</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">p</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">x</span>)
<span class="ruby-identifier">x</span>.<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">puts</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">inspect</span> } <span class="ruby-comment cmt">#p(*x)</span>
<span class="ruby-identifier">x</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-value">1</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">x</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">last</span> <span class="ruby-comment cmt">#x.last</span>
@@ -1468,11 +1468,11 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000411"></a><b>populate</b>(data=nil) {|| ...}
+ <a name="M000417"></a><b>populate</b>(data=nil) {|| ...}
</div>
<div class="description">
<p>
Assign via accessor methods using a hash, associative array or block.
</p>
@@ -1482,11 +1482,11 @@
object.populate( [:a, 1], [:b, 2] )
object.populate( *[[:a, 1], [:b, 2]] )
object.populate{ |s| s.a = 1; s.b = 2 }
</pre>
<p>
-These are all the same <a href="Kernel.html#M000369">as</a> doing:
+These are all the same <a href="Kernel.html#M000375">as</a> doing:
</p>
<pre>
object.a = 1
object.b = 2
</pre>
@@ -1500,12 +1500,12 @@
<p>
TODO: Better name, set_with ?
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000411_source')" id="l_M000411_source">+</a> ]</p>
- <div id="M000411_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000417_source')" id="l_M000417_source">+</a> ]</p>
+ <div id="M000417_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/populate.rb, line 25</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">populate</span>(<span class="ruby-identifier">data</span>=<span class="ruby-keyword kw">nil</span>) <span class="ruby-comment cmt">#:yield:</span>
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">data</span>
<span class="ruby-identifier">data</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
@@ -1519,38 +1519,38 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000361"></a><b>promise</b>( ) {|result| ...}
+ <a name="M000367"></a><b>promise</b>( ) {|result| ...}
</div>
<div class="description">
<p>
-The <a href="Kernel.html#M000361">promise</a>() function is used together
-<a href="Kernel.html#M000397">with</a> <a
-href="Kernel.html#M000362">demand</a>() to implement lazy evaluation. It
-returns a <a href="Kernel.html#M000361">promise</a> to evaluate the
-provided block at a <a href="Kernel.html#M000363">future</a> time.
+The <a href="Kernel.html#M000367">promise</a>() function is used together
+<a href="Kernel.html#M000403">with</a> <a
+href="Kernel.html#M000368">demand</a>() to implement lazy evaluation. It
+returns a <a href="Kernel.html#M000367">promise</a> to evaluate the
+provided block at a <a href="Kernel.html#M000369">future</a> time.
Evaluation can be demanded and the block‘s result obtained via the <a
-href="Kernel.html#M000362">demand</a>() function.
+href="Kernel.html#M000368">demand</a>() function.
</p>
<p>
Implicit evaluation is also supported: the first message sent to it will <a
-href="Kernel.html#M000362">demand</a> evaluation, after which that message
+href="Kernel.html#M000368">demand</a> evaluation, after which that message
and any subsequent messages will be forwarded to the result object.
</p>
<p>
As an aid to circular programming, the block will be passed a <a
-href="Kernel.html#M000361">promise</a> for its own result when it is
+href="Kernel.html#M000367">promise</a> for its own result when it is
evaluated. Be careful not to force that <a
-href="Kernel.html#M000361">promise</a> during the computation, lest the
+href="Kernel.html#M000367">promise</a> during the computation, lest the
computation diverge.
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000361_source')" id="l_M000361_source">+</a> ]</p>
- <div id="M000361_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000367_source')" id="l_M000367_source">+</a> ]</p>
+ <div id="M000367_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/lazy.rb, line 208</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">promise</span>( <span class="ruby-operator">&</span><span class="ruby-identifier">computation</span> ) <span class="ruby-comment cmt">#:yields: result</span>
<span class="ruby-constant">Lazy</span><span class="ruby-operator">::</span><span class="ruby-constant">Promise</span>.<span class="ruby-identifier">new</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">computation</span>)
<span class="ruby-keyword kw">end</span>
@@ -1558,28 +1558,28 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000392"></a><b>qua_class</b>(&block)
+ <a name="M000398"></a><b>qua_class</b>(&block)
</div>
<div class="description">
<p>
Easy access to an object qua class, otherwise known <a
-href="Kernel.html#M000369">as</a> the object‘s <a
-href="Kernel.html#M000406">singleton</a> class.
+href="Kernel.html#M000375">as</a> the object‘s <a
+href="Kernel.html#M000412">singleton</a> class.
</p>
<p>
Yes, another one.
</p>
<p>
CREDIT: Trans
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000392_source')" id="l_M000392_source">+</a> ]</p>
- <div id="M000392_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000398_source')" id="l_M000398_source">+</a> ]</p>
+ <div id="M000398_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/qua_class.rb, line 10</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">qua_class</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
(<span class="ruby-keyword kw">class</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">end</span>).<span class="ruby-identifier">class_eval</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
@@ -1591,24 +1591,24 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000391"></a><b>require_all</b>(pat)
+ <a name="M000397"></a><b>require_all</b>(pat)
</div>
<div class="description">
<p>
Require a pattern of files. This make is easy to require an entire
-directory, for <a href="Kernel.html#M000378">instance</a>.
+directory, for <a href="Kernel.html#M000384">instance</a>.
</p>
<pre>
require_all 'facets/time/*'
</pre>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000391_source')" id="l_M000391_source">+</a> ]</p>
- <div id="M000391_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000397_source')" id="l_M000397_source">+</a> ]</p>
+ <div id="M000397_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/require_all.rb, line 8</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">require_all</span>(<span class="ruby-identifier">pat</span>)
<span class="ruby-identifier">$LOAD_PATH</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">path</span><span class="ruby-operator">|</span>
<span class="ruby-identifier">fs</span> = <span class="ruby-constant">Dir</span>[<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">path</span>,<span class="ruby-identifier">pat</span>)]
@@ -1624,24 +1624,24 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000415"></a><b>require_local</b>(fname)
+ <a name="M000421"></a><b>require_local</b>(fname)
</div>
<div class="description">
<p>
-Require file from same dir <a href="Kernel.html#M000369">as</a> calling
+Require file from same dir <a href="Kernel.html#M000375">as</a> calling
script.
</p>
<pre>
require_local 'templib'
</pre>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000415_source')" id="l_M000415_source">+</a> ]</p>
- <div id="M000415_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000421_source')" id="l_M000421_source">+</a> ]</p>
+ <div id="M000421_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/require_local.rb, line 7</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">require_local</span>(<span class="ruby-identifier">fname</span>)
<span class="ruby-comment cmt">#fdir = File.expand_path( File.dirname( caller[0] ) )</span>
<span class="ruby-identifier">fdir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>( <span class="ruby-identifier">caller</span>[<span class="ruby-value">0</span>] )
@@ -1651,11 +1651,11 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000393"></a><b>resc</b>(str)
+ <a name="M000399"></a><b>resc</b>(str)
</div>
<div class="description">
<p>
Provides a shortcut to the Regexp.escape module method.
</p>
@@ -1667,12 +1667,12 @@
<p>
CREDIT: Trans
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000393_source')" id="l_M000393_source">+</a> ]</p>
- <div id="M000393_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000399_source')" id="l_M000399_source">+</a> ]</p>
+ <div id="M000399_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/resc.rb, line 11</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">resc</span>(<span class="ruby-identifier">str</span>)
<span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">escape</span>(<span class="ruby-identifier">str</span>.<span class="ruby-identifier">to_s</span>)
<span class="ruby-keyword kw">end</span>
@@ -1680,16 +1680,16 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000417"></a><b>respond</b>(sym, *args)
+ <a name="M000423"></a><b>respond</b>(sym, *args)
</div>
<div class="description">
<p>
Like respond_to? but returns the result of the call if it does indeed <a
-href="Kernel.html#M000417">respond</a>.
+href="Kernel.html#M000423">respond</a>.
</p>
<pre>
class X
def f; "f"; end
end
@@ -1702,15 +1702,15 @@
CREDIT: Trans
</p>
</div>
<div class="aka">
This method is also aliased as
- <a href="Kernel.html#M000418">respond_with_value</a>
+ <a href="Kernel.html#M000424">respond_with_value</a>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000417_source')" id="l_M000417_source">+</a> ]</p>
- <div id="M000417_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000423_source')" id="l_M000423_source">+</a> ]</p>
+ <div id="M000423_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/respond.rb, line 16</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">respond</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">sym</span>)
<span class="ruby-identifier">send</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
@@ -1719,21 +1719,21 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000418"></a><b>respond_with_value</b>(sym, *args)
+ <a name="M000424"></a><b>respond_with_value</b>(sym, *args)
</div>
<div class="description">
<p>
-Alias for <a href="Kernel.html#M000417">respond</a>
+Alias for <a href="Kernel.html#M000423">respond</a>
</p>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000409"></a><b>returning</b>(obj=self) {|| ...}
+ <a name="M000415"></a><b>returning</b>(obj=self) {|| ...}
</div>
<div class="description">
<p>
A Ruby-ized realization of the K combinator.
</p>
@@ -1742,24 +1742,24 @@
book.title = "Imperium"
book.author = "Ulick Varange"
end
</pre>
<p>
-Technically, <a href="Kernel.html#M000409">returning</a> probably should
+Technically, <a href="Kernel.html#M000415">returning</a> probably should
force the return of the stated object irregardless of any return statements
that might appear within it‘s block. This might differentiate <a
-href="Kernel.html#M000409">returning</a> from <a
-href="Kernel.html#M000397">with</a>, however it also would require
+href="Kernel.html#M000415">returning</a> from <a
+href="Kernel.html#M000403">with</a>, however it also would require
implementation in Ruby itself.
</p>
<p>
CREDIT: Mikael Brockman
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000409_source')" id="l_M000409_source">+</a> ]</p>
- <div id="M000409_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000415_source')" id="l_M000415_source">+</a> ]</p>
+ <div id="M000415_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/returning.rb, line 18</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">returning</span>(<span class="ruby-identifier">obj</span>=<span class="ruby-keyword kw">self</span>) <span class="ruby-comment cmt">#:yield:</span>
<span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">obj</span>
<span class="ruby-identifier">obj</span>
@@ -1768,23 +1768,23 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000370"></a><b>send_as</b>(ancestor, sym, *args, &blk)
+ <a name="M000376"></a><b>send_as</b>(ancestor, sym, *args, &blk)
</div>
<div class="description">
<p>
Call parent class/module methods once bound to self.
</p>
<p>
TODO: Does this have the proper scope for send?
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000370_source')" id="l_M000370_source">+</a> ]</p>
- <div id="M000370_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000376_source')" id="l_M000376_source">+</a> ]</p>
+ <div id="M000376_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/as.rb, line 36</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_as</span>(<span class="ruby-identifier">ancestor</span>, <span class="ruby-identifier">sym</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">blk</span>)
<span class="ruby-identifier">ancestor</span>.<span class="ruby-identifier">instance_method</span>(<span class="ruby-identifier">sym</span>).<span class="ruby-identifier">bind</span>(<span class="ruby-keyword kw">self</span>).<span class="ruby-identifier">call</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>,<span class="ruby-operator">&</span><span class="ruby-identifier">blk</span>)
<span class="ruby-keyword kw">end</span>
@@ -1792,11 +1792,11 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000412"></a><b>set_from</b>(obj, *fields)
+ <a name="M000418"></a><b>set_from</b>(obj, *fields)
</div>
<div class="description">
<p>
Set setter methods using a another object.
</p>
@@ -1819,12 +1819,12 @@
<p>
TODO: populate_from(obj) ?
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000412_source')" id="l_M000412_source">+</a> ]</p>
- <div id="M000412_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000418_source')" id="l_M000418_source">+</a> ]</p>
+ <div id="M000418_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/populate.rb, line 54</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_from</span>(<span class="ruby-identifier">obj</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">fields</span>)
<span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">fields</span>.<span class="ruby-identifier">empty?</span>
<span class="ruby-identifier">fields</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span>
@@ -1846,15 +1846,15 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000386"></a><b>silence_stderr</b>( {|| ...}
+ <a name="M000392"></a><b>silence_stderr</b>( {|| ...}
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000386_source')" id="l_M000386_source">+</a> ]</p>
- <div id="M000386_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000392_source')" id="l_M000392_source">+</a> ]</p>
+ <div id="M000392_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/silence.rb, line 27</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">silence_stderr</span> <span class="ruby-comment cmt">#:yeild:</span>
<span class="ruby-identifier">silence_stream</span>(<span class="ruby-constant">STDERR</span>) { <span class="ruby-keyword kw">yield</span> }
<span class="ruby-keyword kw">end</span>
@@ -1862,15 +1862,15 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000387"></a><b>silence_stdout</b>( {|| ...}
+ <a name="M000393"></a><b>silence_stdout</b>( {|| ...}
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000387_source')" id="l_M000387_source">+</a> ]</p>
- <div id="M000387_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000393_source')" id="l_M000393_source">+</a> ]</p>
+ <div id="M000393_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/silence.rb, line 32</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">silence_stdout</span> <span class="ruby-comment cmt">#:yeild:</span>
<span class="ruby-identifier">silence_stream</span>(<span class="ruby-constant">STDOUT</span>) { <span class="ruby-keyword kw">yield</span> }
<span class="ruby-keyword kw">end</span>
@@ -1878,11 +1878,11 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000385"></a><b>silence_stream</b>(*streams) {|| ...}
+ <a name="M000391"></a><b>silence_stream</b>(*streams) {|| ...}
</div>
<div class="description">
<p>
Silences any stream for the duration of the block.
</p>
@@ -1896,12 +1896,12 @@
<p>
CREDIT: David Heinemeier Hansson
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000385_source')" id="l_M000385_source">+</a> ]</p>
- <div id="M000385_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000391_source')" id="l_M000391_source">+</a> ]</p>
+ <div id="M000391_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/silence.rb, line 13</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">silence_stream</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">streams</span>) <span class="ruby-comment cmt">#:yeild:</span>
<span class="ruby-identifier">on_hold</span> = <span class="ruby-identifier">streams</span>.<span class="ruby-identifier">collect</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">stream</span><span class="ruby-operator">|</span> <span class="ruby-identifier">stream</span>.<span class="ruby-identifier">dup</span> }
<span class="ruby-identifier">streams</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">stream</span><span class="ruby-operator">|</span>
@@ -1918,11 +1918,11 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000389"></a><b>silence_warnings</b>() {|| ...}
+ <a name="M000395"></a><b>silence_warnings</b>() {|| ...}
</div>
<div class="description">
<p>
Sets $VERBOSE to nil for the duration of the block and back to its original
value afterwards.
@@ -1937,12 +1937,12 @@
<p>
CREDIT: David Heinemeier Hansson
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000389_source')" id="l_M000389_source">+</a> ]</p>
- <div id="M000389_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000395_source')" id="l_M000395_source">+</a> ]</p>
+ <div id="M000395_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/silence.rb, line 55</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">silence_warnings</span>
<span class="ruby-identifier">old_verbose</span>, <span class="ruby-identifier">$VERBOSE</span> = <span class="ruby-identifier">$VERBOSE</span>, <span class="ruby-keyword kw">nil</span>
<span class="ruby-keyword kw">yield</span>
@@ -1953,21 +1953,21 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000388"></a><b>silently</b>(*streams) {|| ...}
+ <a name="M000394"></a><b>silently</b>(*streams) {|| ...}
</div>
<div class="description">
<p>
-Just like <a href="Kernel.html#M000385">silence_stream</a>, but will
+Just like <a href="Kernel.html#M000391">silence_stream</a>, but will
default to STDOUT, STDERR if no streams are given.
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000388_source')" id="l_M000388_source">+</a> ]</p>
- <div id="M000388_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000394_source')" id="l_M000394_source">+</a> ]</p>
+ <div id="M000394_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/silence.rb, line 39</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">silently</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">streams</span>) <span class="ruby-comment cmt">#:yeild:</span>
<span class="ruby-identifier">streams</span> = [<span class="ruby-constant">STDOUT</span>, <span class="ruby-constant">STDERR</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">streams</span>.<span class="ruby-identifier">empty?</span>
<span class="ruby-identifier">silence_stream</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">streams</span>){ <span class="ruby-keyword kw">yield</span> }
@@ -1976,21 +1976,21 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000406"></a><b>singleton</b>(&block)
+ <a name="M000412"></a><b>singleton</b>(&block)
</div>
<div class="description">
<p>
-Alias for <a href="Kernel.html#M000405">singleton_class</a>
+Alias for <a href="Kernel.html#M000411">singleton_class</a>
</p>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000405"></a><b>singleton_class</b>(&block)
+ <a name="M000411"></a><b>singleton_class</b>(&block)
</div>
<div class="description">
<p>
Easy access to an object‘s "special" class,
</p>
@@ -1998,15 +1998,15 @@
One day these names must be reconciled!
</p>
</div>
<div class="aka">
This method is also aliased as
- <a href="Kernel.html#M000406">singleton</a>
+ <a href="Kernel.html#M000412">singleton</a>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000405_source')" id="l_M000405_source">+</a> ]</p>
- <div id="M000405_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000411_source')" id="l_M000411_source">+</a> ]</p>
+ <div id="M000411_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/singleton_class.rb, line 7</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">singleton_class</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
(<span class="ruby-keyword kw">class</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">end</span>).<span class="ruby-identifier">class_eval</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
@@ -2018,11 +2018,11 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000372"></a><b>super_as</b>(klass=self.class.superclass, *args, &blk)
+ <a name="M000378"></a><b>super_as</b>(klass=self.class.superclass, *args, &blk)
</div>
<div class="description">
<p>
Like super but skips to a specific ancestor module or class.
</p>
@@ -2041,12 +2041,12 @@
C.new.x #=> 1
</pre>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000372_source')" id="l_M000372_source">+</a> ]</p>
- <div id="M000372_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000378_source')" id="l_M000378_source">+</a> ]</p>
+ <div id="M000378_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/as.rb, line 73</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">super_as</span>(<span class="ruby-identifier">klass</span>=<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">superclass</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">blk</span>)
<span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">ancestors</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">klass</span>)
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>
@@ -2058,20 +2058,20 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000371"></a><b>super_method</b>(klass, meth)
+ <a name="M000377"></a><b>super_method</b>(klass, meth)
</div>
<div class="description">
<p>
Returns method of a parent class bound to self.
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000371_source')" id="l_M000371_source">+</a> ]</p>
- <div id="M000371_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000377_source')" id="l_M000377_source">+</a> ]</p>
+ <div id="M000377_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/as.rb, line 50</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">super_method</span>(<span class="ruby-identifier">klass</span>, <span class="ruby-identifier">meth</span>)
<span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">ancestors</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">klass</span>)
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">"Not an ancestor for super_method-- #{klass}"</span>
@@ -2082,21 +2082,21 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000377"></a><b>tap</b>() {|self| ...}
+ <a name="M000383"></a><b>tap</b>() {|self| ...}
</div>
<div class="description">
<p>
-The <a href="Kernel.html#M000377">tap</a> K-Combinator. This yields self
+The <a href="Kernel.html#M000383">tap</a> K-Combinator. This yields self
-and- returns self.
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000377_source')" id="l_M000377_source">+</a> ]</p>
- <div id="M000377_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000383_source')" id="l_M000383_source">+</a> ]</p>
+ <div id="M000383_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/tap.rb, line 7</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tap</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">b</span>)
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
<span class="ruby-identifier">b</span>.<span class="ruby-identifier">arity</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">yield</span>(<span class="ruby-keyword kw">self</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">instance_eval</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">b</span>)
@@ -2107,11 +2107,11 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000364"></a><b>to_b</b>()
+ <a name="M000370"></a><b>to_b</b>()
</div>
<div class="description">
<p>
Boolean conversion for not being nil or false. Other classes may redefine
this to suite the particular need.
@@ -2122,12 +2122,12 @@
false.to_b #=> false
nil.to_b #=> false
</pre>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000364_source')" id="l_M000364_source">+</a> ]</p>
- <div id="M000364_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000370_source')" id="l_M000370_source">+</a> ]</p>
+ <div id="M000370_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/boolean.rb, line 94</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_b</span>
<span class="ruby-keyword kw">self</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">true</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">false</span>
<span class="ruby-keyword kw">end</span>
@@ -2135,11 +2135,11 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000365"></a><b>true?</b>()
+ <a name="M000371"></a><b>true?</b>()
</div>
<div class="description">
<p>
Returns true is an object is class <a href="TrueClass.html">TrueClass</a>,
otherwise false.
@@ -2149,12 +2149,12 @@
false.true? #=> false
nil.true? #=> false
</pre>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000365_source')" id="l_M000365_source">+</a> ]</p>
- <div id="M000365_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000371_source')" id="l_M000371_source">+</a> ]</p>
+ <div id="M000371_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/boolean.rb, line 105</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">true?</span>
(<span class="ruby-keyword kw">true</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">self</span>)
<span class="ruby-keyword kw">end</span>
@@ -2162,11 +2162,11 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000407"></a><b>try</b>(method, default=nil)
+ <a name="M000413"></a><b>try</b>(method, default=nil)
</div>
<div class="description">
<p>
Try a method.
</p>
@@ -2182,12 +2182,12 @@
<p>
CREDIT: Chris Wanstrath
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000407_source')" id="l_M000407_source">+</a> ]</p>
- <div id="M000407_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000413_source')" id="l_M000413_source">+</a> ]</p>
+ <div id="M000413_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/try.rb, line 12</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">try</span>(<span class="ruby-identifier">method</span>, <span class="ruby-identifier">default</span>=<span class="ruby-keyword kw">nil</span>)
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">respond_to?</span> <span class="ruby-identifier">method</span>
<span class="ruby-identifier">send</span> <span class="ruby-identifier">method</span>
@@ -2199,11 +2199,11 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000413"></a><b>val?</b>()
+ <a name="M000419"></a><b>val?</b>()
</div>
<div class="description">
<p>
Tests to see if something has value. An object is considered to have value
if it is not nil? and if it responds to empty?, is not empty.
@@ -2214,12 +2214,12 @@
10.val? #=> true
[nil].val? #=> true
</pre>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000413_source')" id="l_M000413_source">+</a> ]</p>
- <div id="M000413_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000419_source')" id="l_M000419_source">+</a> ]</p>
+ <div id="M000419_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/val.rb, line 12</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">val?</span>
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">nil?</span>
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">empty?</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:empty?</span>)
@@ -2229,15 +2229,15 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000397"></a><b>with</b>(obj=self, &block)
+ <a name="M000403"></a><b>with</b>(obj=self, &block)
</div>
<div class="description">
<p>
-Like <a href="Kernel.html#M000409">returning</a> but exectures the block
+Like <a href="Kernel.html#M000415">returning</a> but exectures the block
via instance_eval.
</p>
<pre>
def foo
with values = [] do
@@ -2248,11 +2248,11 @@
foo # => ['bar', 'baz']
</pre>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000397_source')" id="l_M000397_source">+</a> ]</p>
- <div id="M000397_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000403_source')" id="l_M000403_source">+</a> ]</p>
+ <div id="M000403_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/kernel/with.rb, line 15</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">with</span>(<span class="ruby-identifier">obj</span>=<span class="ruby-keyword kw">self</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
<span class="ruby-identifier">obj</span>.<span class="ruby-identifier">instance_eval</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
<span class="ruby-keyword kw">end</span>
\ No newline at end of file