doc/rdoc/more/classes/Interval.html in facets-2.4.4 vs doc/rdoc/more/classes/Interval.html in facets-2.4.5
- old
+ new
@@ -30,16 +30,16 @@
return false;
if( elem.style.display == "block" )
{
elem.style.display = "none"
- link.innerHTML = "show source"
+ link.innerHTML = "+"
}
else
{
elem.style.display = "block"
- link.innerHTML = "hide source"
+ link.innerHTML = "-"
}
}
function openCode( url )
{
@@ -112,48 +112,46 @@
</div>
<div class="sectiontitle">Methods</div>
- <ul>
- <li><a href="#M000564">+@</a></li>
- <li><a href="#M000565">-@</a></li>
- <li><a href="#M000574">===</a></li>
- <li><a href="#M000543">[]</a></li>
- <li><a href="#M000550">begin</a></li>
- <li><a href="#M000557">closed</a></li>
- <li><a href="#M000554">degenerate?</a></li>
- <li><a href="#M000556">direction</a></li>
- <li><a href="#M000568">distance</a></li>
- <li><a href="#M000576">each</a></li>
- <li><a href="#M000551">end</a></li>
- <li><a href="#M000578">eql?</a></li>
- <li><a href="#M000552">exclude_begin?</a></li>
- <li><a href="#M000553">exclude_end?</a></li>
- <li><a href="#M000548">exclude_first?</a></li>
- <li><a href="#M000549">exclude_last?</a></li>
- <li><a href="#M000546">first</a></li>
- <li><a href="#M000560">first_closed</a></li>
- <li><a href="#M000562">first_opened</a></li>
- <li><a href="#M000559">half_closed</a></li>
- <li><a href="#M000573">include?</a></li>
- <li><a href="#M000547">last</a></li>
- <li><a href="#M000561">last_closed</a></li>
- <li><a href="#M000563">last_opened</a></li>
- <li><a href="#M000569">length</a></li>
- <li><a href="#M000572">max</a></li>
- <li><a href="#M000575">member?</a></li>
- <li><a href="#M000571">min</a></li>
- <li><a href="#M000544">new</a></li>
- <li><a href="#M000555">null?</a></li>
- <li><a href="#M000558">opened</a></li>
- <li><a href="#M000567">reversed</a></li>
- <li><a href="#M000545">sentinels</a></li>
- <li><a href="#M000570">size</a></li>
- <li><a href="#M000577">step</a></li>
- <li><a href="#M000566">~</a></li>
- </ul>
+ <span style="padding-right: 5px;"><a href="#M000562">+@</a></span>
+ <span style="padding-right: 5px;"><a href="#M000563">-@</a></span>
+ <span style="padding-right: 5px;"><a href="#M000572">===</a></span>
+ <span style="padding-right: 5px;"><a href="#M000541">[]</a></span>
+ <span style="padding-right: 5px;"><a href="#M000548">begin</a></span>
+ <span style="padding-right: 5px;"><a href="#M000555">closed</a></span>
+ <span style="padding-right: 5px;"><a href="#M000552">degenerate?</a></span>
+ <span style="padding-right: 5px;"><a href="#M000554">direction</a></span>
+ <span style="padding-right: 5px;"><a href="#M000566">distance</a></span>
+ <span style="padding-right: 5px;"><a href="#M000574">each</a></span>
+ <span style="padding-right: 5px;"><a href="#M000549">end</a></span>
+ <span style="padding-right: 5px;"><a href="#M000576">eql?</a></span>
+ <span style="padding-right: 5px;"><a href="#M000550">exclude_begin?</a></span>
+ <span style="padding-right: 5px;"><a href="#M000551">exclude_end?</a></span>
+ <span style="padding-right: 5px;"><a href="#M000546">exclude_first?</a></span>
+ <span style="padding-right: 5px;"><a href="#M000547">exclude_last?</a></span>
+ <span style="padding-right: 5px;"><a href="#M000544">first</a></span>
+ <span style="padding-right: 5px;"><a href="#M000558">first_closed</a></span>
+ <span style="padding-right: 5px;"><a href="#M000560">first_opened</a></span>
+ <span style="padding-right: 5px;"><a href="#M000557">half_closed</a></span>
+ <span style="padding-right: 5px;"><a href="#M000571">include?</a></span>
+ <span style="padding-right: 5px;"><a href="#M000545">last</a></span>
+ <span style="padding-right: 5px;"><a href="#M000559">last_closed</a></span>
+ <span style="padding-right: 5px;"><a href="#M000561">last_opened</a></span>
+ <span style="padding-right: 5px;"><a href="#M000567">length</a></span>
+ <span style="padding-right: 5px;"><a href="#M000570">max</a></span>
+ <span style="padding-right: 5px;"><a href="#M000573">member?</a></span>
+ <span style="padding-right: 5px;"><a href="#M000569">min</a></span>
+ <span style="padding-right: 5px;"><a href="#M000542">new</a></span>
+ <span style="padding-right: 5px;"><a href="#M000553">null?</a></span>
+ <span style="padding-right: 5px;"><a href="#M000556">opened</a></span>
+ <span style="padding-right: 5px;"><a href="#M000565">reversed</a></span>
+ <span style="padding-right: 5px;"><a href="#M000543">sentinels</a></span>
+ <span style="padding-right: 5px;"><a href="#M000568">size</a></span>
+ <span style="padding-right: 5px;"><a href="#M000575">step</a></span>
+ <span style="padding-right: 5px;"><a href="#M000564">~</a></span>
<div class="sectiontitle">Included Modules</div>
<ul>
<li><a href="Multiton.html">Multiton</a></li>
<li><a href="EnumerablePass.html">EnumerablePass</a></li>
@@ -164,15 +162,15 @@
<div class="sectiontitle">Public Class methods</div>
<div class="method">
<div class="title">
- <a name="M000543"></a><b>[]</b>( *args )
+ <a name="M000541"></a><b>[]</b>( *args )
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000543_source')" id="l_M000543_source">show source</a> ]</p>
- <div id="M000543_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000541_source')" id="l_M000541_source">+</a> ]</p>
+ <div id="M000541_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/more/facets/interval.rb, line 89</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-operator">[]</span>( <span class="ruby-operator">*</span><span class="ruby-identifier">args</span> )
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">new</span>( <span class="ruby-operator">*</span><span class="ruby-identifier">args</span> )
<span class="ruby-keyword kw">end</span>
@@ -180,15 +178,15 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000544"></a><b>new</b>(first, last, exclude_first=false, exclude_last=false )
+ <a name="M000542"></a><b>new</b>(first, last, exclude_first=false, exclude_last=false )
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000544_source')" id="l_M000544_source">show source</a> ]</p>
- <div id="M000544_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000542_source')" id="l_M000542_source">+</a> ]</p>
+ <div id="M000542_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/more/facets/interval.rb, line 93</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">first</span>, <span class="ruby-identifier">last</span>, <span class="ruby-identifier">exclude_first</span>=<span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">exclude_last</span>=<span class="ruby-keyword kw">false</span> )
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"bad value for interval"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">first</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">last</span>.<span class="ruby-identifier">class</span>
<span class="ruby-ivar">@first</span> = <span class="ruby-identifier">first</span>
@@ -202,155 +200,155 @@
</div>
</div>
<div class="sectiontitle">Public Instance methods</div>
<div class="method">
<div class="title">
- <a name="M000564"></a><b>+@</b>()
+ <a name="M000562"></a><b>+@</b>()
</div>
<div class="description">
<p>
-Unary shorthands. These return a <a href="Interval.html#M000544">new</a>
-interval exclusive of <a href="Interval.html#M000546">first</a>, <a
-href="Interval.html#M000547">last</a> or both <a
-href="Interval.html#M000545">sentinels</a>, repectively.
+Unary shorthands. These return a <a href="Interval.html#M000542">new</a>
+interval exclusive of <a href="Interval.html#M000544">first</a>, <a
+href="Interval.html#M000545">last</a> or both <a
+href="Interval.html#M000543">sentinels</a>, repectively.
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000564_source')" id="l_M000564_source">show source</a> ]</p>
- <div id="M000564_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000562_source')" id="l_M000562_source">+</a> ]</p>
+ <div id="M000562_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/more/facets/interval.rb, line 159</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">+@</span> ; <span class="ruby-constant">Interval</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">first</span>, <span class="ruby-identifier">last</span>, <span class="ruby-keyword kw">true</span>, <span class="ruby-keyword kw">false</span>) ; <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000565"></a><b>-@</b>()
+ <a name="M000563"></a><b>-@</b>()
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000565_source')" id="l_M000565_source">show source</a> ]</p>
- <div id="M000565_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000563_source')" id="l_M000563_source">+</a> ]</p>
+ <div id="M000563_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/more/facets/interval.rb, line 160</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">-@</span> ; <span class="ruby-constant">Interval</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">first</span>, <span class="ruby-identifier">last</span>, <span class="ruby-keyword kw">false</span>, <span class="ruby-keyword kw">true</span>) ; <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000574"></a><b>===</b>(x)
+ <a name="M000572"></a><b>===</b>(x)
</div>
<div class="description">
<p>
Alias for include?
</p>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000550"></a><b>begin</b>()
+ <a name="M000548"></a><b>begin</b>()
</div>
<div class="description">
<p>
-Alias for <a href="Interval.html#M000546">first</a>
+Alias for <a href="Interval.html#M000544">first</a>
</p>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000557"></a><b>closed</b>()
+ <a name="M000555"></a><b>closed</b>()
</div>
<div class="description">
<p>
-Returns a <a href="Interval.html#M000544">new</a> interval inclusive of of
-both <a href="Interval.html#M000545">sentinels</a>.
+Returns a <a href="Interval.html#M000542">new</a> interval inclusive of of
+both <a href="Interval.html#M000543">sentinels</a>.
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000557_source')" id="l_M000557_source">show source</a> ]</p>
- <div id="M000557_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000555_source')" id="l_M000555_source">+</a> ]</p>
+ <div id="M000555_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/more/facets/interval.rb, line 139</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">closed</span>; <span class="ruby-constant">Interval</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@first</span>, <span class="ruby-ivar">@last</span>, <span class="ruby-keyword kw">true</span>, <span class="ruby-keyword kw">true</span>) ; <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000554"></a><b>degenerate?</b>()
+ <a name="M000552"></a><b>degenerate?</b>()
</div>
<div class="description">
<p>
Returns <tt>true</tt> if the start and <a
-href="Interval.html#M000551">end</a> <a
-href="Interval.html#M000545">sentinels</a> are equal and the interval is <a
-href="Interval.html#M000557">closed</a>; otherwise <tt>false</tt>.
+href="Interval.html#M000549">end</a> <a
+href="Interval.html#M000543">sentinels</a> are equal and the interval is <a
+href="Interval.html#M000555">closed</a>; otherwise <tt>false</tt>.
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000554_source')" id="l_M000554_source">show source</a> ]</p>
- <div id="M000554_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000552_source')" id="l_M000552_source">+</a> ]</p>
+ <div id="M000552_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/more/facets/interval.rb, line 125</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">degenerate?</span> ; <span class="ruby-ivar">@direction</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-keyword kw">and</span> <span class="ruby-operator">!</span> (<span class="ruby-ivar">@exclusive_first</span> <span class="ruby-keyword kw">or</span> <span class="ruby-ivar">@exclusive_last</span>) ; <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000556"></a><b>direction</b>()
+ <a name="M000554"></a><b>direction</b>()
</div>
<div class="description">
<p>
-Returns the <a href="Interval.html#M000556">direction</a> of the interval
+Returns the <a href="Interval.html#M000554">direction</a> of the interval
indicated by +1, 0 or -1.
</p>
<pre>
(1..5).direction #=> 1
(5..1).direction #=> -1
(1..1).direction #=> 0
</pre>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000556_source')" id="l_M000556_source">show source</a> ]</p>
- <div id="M000556_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000554_source')" id="l_M000554_source">+</a> ]</p>
+ <div id="M000554_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/more/facets/interval.rb, line 136</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">direction</span> ; <span class="ruby-ivar">@direction</span> ; <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000568"></a><b>distance</b>()
+ <a name="M000566"></a><b>distance</b>()
</div>
<div class="description">
<p>
-Returns the <a href="Interval.html#M000569">length</a> of the interval as
-the difference between the <a href="Interval.html#M000546">first</a> and <a
-href="Interval.html#M000547">last</a> elements. Returns <tt>nil</tt> if the
+Returns the <a href="Interval.html#M000567">length</a> of the interval as
+the difference between the <a href="Interval.html#M000544">first</a> and <a
+href="Interval.html#M000545">last</a> elements. Returns <tt>nil</tt> if the
sentinal objects do not support <a
-href="Interval.html#M000568">distance</a> comparison (<a
-href="Interval.html#M000568">distance</a>). TODO: Add <tt>n</tt> parameter
+href="Interval.html#M000566">distance</a> comparison (<a
+href="Interval.html#M000566">distance</a>). TODO: Add <tt>n</tt> parameter
to count segmentations like those produced by <a
-href="Interval.html#M000576">each</a>.
+href="Interval.html#M000574">each</a>.
</p>
</div>
<div class="aka">
This method is also aliased as
- <a href="Interval.html#M000569">length</a>
- <a href="Interval.html#M000570">size</a>
+ <a href="Interval.html#M000567">length</a>
+ <a href="Interval.html#M000568">size</a>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000568_source')" id="l_M000568_source">show source</a> ]</p>
- <div id="M000568_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000566_source')" id="l_M000566_source">+</a> ]</p>
+ <div id="M000566_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/more/facets/interval.rb, line 175</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">distance</span>
<span class="ruby-ivar">@last</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@first</span>
<span class="ruby-comment cmt">#if @last.respond_to?( :distance )</span>
@@ -363,39 +361,39 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000576"></a><b>each</b>(n=1, d=nil) {|| ...}
+ <a name="M000574"></a><b>each</b>(n=1, d=nil) {|| ...}
</div>
<div class="description">
<p>
Iterates over the interval, passing <a
-href="Interval.html#M000576">each</a> _n_th element to the block. If n is
+href="Interval.html#M000574">each</a> _n_th element to the block. If n is
not given then n defaults to 1. Each _n_th <a
-href="Interval.html#M000577">step</a> is determined by invoking +++ or +\-+
-n, depending on the <a href="Interval.html#M000556">direction</a> of the
+href="Interval.html#M000575">step</a> is determined by invoking +++ or +\-+
+n, depending on the <a href="Interval.html#M000554">direction</a> of the
interval. If n is negative the iteration is preformed in reverse form <a
-href="Interval.html#M000551">end</a> sentinal to front sentinal. A second
+href="Interval.html#M000549">end</a> sentinal to front sentinal. A second
parameter, d, can be given in which case the applied <a
-href="Interval.html#M000577">step</a> is calculated as a fraction of the
-interval‘s <a href="Interval.html#M000569">length</a> times n / d.
+href="Interval.html#M000575">step</a> is calculated as a fraction of the
+interval‘s <a href="Interval.html#M000567">length</a> times n / d.
This allows iteration over the whole interval in equal sized segments.
</p>
<pre>
1..5.each { |e| ... } #=> 1 2 3 4 5
1..5.each(2) { |e| ... } #=> 1 3 5
1..5.each(1,2) { |e| ... } #=> 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
</pre>
</div>
<div class="aka">
This method is also aliased as
- <a href="Interval.html#M000577">step</a>
+ <a href="Interval.html#M000575">step</a>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000576_source')" id="l_M000576_source">show source</a> ]</p>
- <div id="M000576_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000574_source')" id="l_M000574_source">+</a> ]</p>
+ <div id="M000574_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/more/facets/interval.rb, line 239</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each</span>(<span class="ruby-identifier">n</span>=<span class="ruby-value">1</span>, <span class="ruby-identifier">d</span>=<span class="ruby-keyword kw">nil</span>) <span class="ruby-comment cmt"># :yield:</span>
<span class="ruby-keyword kw">return</span> (<span class="ruby-identifier">n</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span> <span class="ruby-operator">?</span> <span class="ruby-ivar">@last</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@first</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">degenerate?</span> <span class="ruby-comment cmt"># is this right for all values of n ?</span>
<span class="ruby-identifier">s</span> = <span class="ruby-identifier">d</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">*</span> (<span class="ruby-identifier">n</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">d</span>.<span class="ruby-identifier">to_f</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">n</span>.<span class="ruby-identifier">abs</span>
@@ -427,30 +425,30 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000551"></a><b>end</b>()
+ <a name="M000549"></a><b>end</b>()
</div>
<div class="description">
<p>
-Alias for <a href="Interval.html#M000547">last</a>
+Alias for <a href="Interval.html#M000545">last</a>
</p>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000578"></a><b>eql?</b>(other)
+ <a name="M000576"></a><b>eql?</b>(other)
</div>
<div class="description">
<p>
Compares two intervals to see if they are equal
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000578_source')" id="l_M000578_source">show source</a> ]</p>
- <div id="M000578_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000576_source')" id="l_M000576_source">+</a> ]</p>
+ <div id="M000576_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/more/facets/interval.rb, line 274</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">eql?</span>(<span class="ruby-identifier">other</span>)
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@first</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">first</span>
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@last</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">last</span>
@@ -462,141 +460,141 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000552"></a><b>exclude_begin?</b>()
+ <a name="M000550"></a><b>exclude_begin?</b>()
</div>
<div class="description">
<p>
Alias for exclude_first?
</p>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000553"></a><b>exclude_end?</b>()
+ <a name="M000551"></a><b>exclude_end?</b>()
</div>
<div class="description">
<p>
Alias for exclude_last?
</p>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000548"></a><b>exclude_first?</b>()
+ <a name="M000546"></a><b>exclude_first?</b>()
</div>
<div class="aka">
This method is also aliased as
- <a href="Interval.html#M000552">exclude_begin?</a>
+ <a href="Interval.html#M000550">exclude_begin?</a>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000548_source')" id="l_M000548_source">show source</a> ]</p>
- <div id="M000548_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000546_source')" id="l_M000546_source">+</a> ]</p>
+ <div id="M000546_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/more/facets/interval.rb, line 115</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">exclude_first?</span> ; <span class="ruby-ivar">@exclude_first</span> ; <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000549"></a><b>exclude_last?</b>()
+ <a name="M000547"></a><b>exclude_last?</b>()
</div>
<div class="aka">
This method is also aliased as
- <a href="Interval.html#M000553">exclude_end?</a>
+ <a href="Interval.html#M000551">exclude_end?</a>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000549_source')" id="l_M000549_source">show source</a> ]</p>
- <div id="M000549_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000547_source')" id="l_M000547_source">+</a> ]</p>
+ <div id="M000547_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/more/facets/interval.rb, line 116</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">exclude_last?</span> ; <span class="ruby-ivar">@exclude_last</span> ; <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000546"></a><b>first</b>()
+ <a name="M000544"></a><b>first</b>()
</div>
<div class="description">
<p>
-Returns the <a href="Interval.html#M000546">first</a> or <a
-href="Interval.html#M000547">last</a> sentinal of the interval.
+Returns the <a href="Interval.html#M000544">first</a> or <a
+href="Interval.html#M000545">last</a> sentinal of the interval.
</p>
</div>
<div class="aka">
This method is also aliased as
- <a href="Interval.html#M000550">begin</a>
+ <a href="Interval.html#M000548">begin</a>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000546_source')" id="l_M000546_source">show source</a> ]</p>
- <div id="M000546_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000544_source')" id="l_M000544_source">+</a> ]</p>
+ <div id="M000544_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/more/facets/interval.rb, line 111</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">first</span> ; <span class="ruby-ivar">@first</span> ; <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000560"></a><b>first_closed</b>()
+ <a name="M000558"></a><b>first_closed</b>()
</div>
<div class="description">
<p>
-Returns a <a href="Interval.html#M000544">new</a> interval with one of the
-two <a href="Interval.html#M000545">sentinels</a> <a
-href="Interval.html#M000558">opened</a> or <a
-href="Interval.html#M000557">closed</a>
+Returns a <a href="Interval.html#M000542">new</a> interval with one of the
+two <a href="Interval.html#M000543">sentinels</a> <a
+href="Interval.html#M000556">opened</a> or <a
+href="Interval.html#M000555">closed</a>
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000560_source')" id="l_M000560_source">show source</a> ]</p>
- <div id="M000560_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000558_source')" id="l_M000558_source">+</a> ]</p>
+ <div id="M000558_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/more/facets/interval.rb, line 152</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">first_closed</span> ; <span class="ruby-constant">Interval</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@first</span>, <span class="ruby-ivar">@last</span>, <span class="ruby-keyword kw">false</span>, <span class="ruby-keyword kw">true</span>) ; <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000562"></a><b>first_opened</b>()
+ <a name="M000560"></a><b>first_opened</b>()
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000562_source')" id="l_M000562_source">show source</a> ]</p>
- <div id="M000562_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000560_source')" id="l_M000560_source">+</a> ]</p>
+ <div id="M000560_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/more/facets/interval.rb, line 154</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">first_opened</span> ; <span class="ruby-constant">Interval</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@first</span>, <span class="ruby-ivar">@last</span>, <span class="ruby-keyword kw">true</span>, <span class="ruby-keyword kw">false</span>) ; <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000559"></a><b>half_closed</b>(e=false)
+ <a name="M000557"></a><b>half_closed</b>(e=false)
</div>
<div class="description">
<p>
-Returns a <a href="Interval.html#M000544">new</a> interval with either the
-<a href="Interval.html#M000546">first</a> or the <a
-href="Interval.html#M000547">last</a> sentinel exclusive. If the parameter
-is false, the deafult, then the <a href="Interval.html#M000546">first</a>
+Returns a <a href="Interval.html#M000542">new</a> interval with either the
+<a href="Interval.html#M000544">first</a> or the <a
+href="Interval.html#M000545">last</a> sentinel exclusive. If the parameter
+is false, the deafult, then the <a href="Interval.html#M000544">first</a>
sentinel is excluded; if the parameter is true, the <a
-href="Interval.html#M000547">last</a> sentinel is excluded.
+href="Interval.html#M000545">last</a> sentinel is excluded.
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000559_source')" id="l_M000559_source">show source</a> ]</p>
- <div id="M000559_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000557_source')" id="l_M000557_source">+</a> ]</p>
+ <div id="M000557_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/more/facets/interval.rb, line 147</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">half_closed</span>(<span class="ruby-identifier">e</span>=<span class="ruby-keyword kw">false</span>)
<span class="ruby-identifier">e</span> <span class="ruby-value">? </span><span class="ruby-constant">Interval</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@first</span>, <span class="ruby-ivar">@last</span>, <span class="ruby-keyword kw">true</span>, <span class="ruby-keyword kw">false</span>) <span class="ruby-operator">:</span> <span class="ruby-constant">Interval</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@first</span>, <span class="ruby-ivar">@last</span>, <span class="ruby-keyword kw">false</span>, <span class="ruby-keyword kw">true</span>)
<span class="ruby-keyword kw">end</span>
@@ -604,25 +602,25 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000573"></a><b>include?</b>(x)
+ <a name="M000571"></a><b>include?</b>(x)
</div>
<div class="description">
<p>
Returns true or false if the element is part of the interval.
</p>
</div>
<div class="aka">
This method is also aliased as
- <a href="Interval.html#M000574">===</a>
- <a href="Interval.html#M000575">member?</a>
+ <a href="Interval.html#M000572">===</a>
+ <a href="Interval.html#M000573">member?</a>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000573_source')" id="l_M000573_source">show source</a> ]</p>
- <div id="M000573_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000571_source')" id="l_M000571_source">+</a> ]</p>
+ <div id="M000571_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/more/facets/interval.rb, line 197</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">include?</span>(<span class="ruby-identifier">x</span>)
<span class="ruby-comment cmt"># todo: infinity?</span>
<span class="ruby-identifier">tf</span> = <span class="ruby-identifier">exclude_first?</span> <span class="ruby-value">? </span><span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-value">0</span>
@@ -633,77 +631,77 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000547"></a><b>last</b>()
+ <a name="M000545"></a><b>last</b>()
</div>
<div class="aka">
This method is also aliased as
- <a href="Interval.html#M000551">end</a>
+ <a href="Interval.html#M000549">end</a>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000547_source')" id="l_M000547_source">show source</a> ]</p>
- <div id="M000547_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000545_source')" id="l_M000545_source">+</a> ]</p>
+ <div id="M000545_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/more/facets/interval.rb, line 112</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">last</span> ; <span class="ruby-ivar">@last</span> ; <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000561"></a><b>last_closed</b>()
+ <a name="M000559"></a><b>last_closed</b>()
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000561_source')" id="l_M000561_source">show source</a> ]</p>
- <div id="M000561_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000559_source')" id="l_M000559_source">+</a> ]</p>
+ <div id="M000559_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/more/facets/interval.rb, line 153</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">last_closed</span> ; <span class="ruby-constant">Interval</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@first</span>, <span class="ruby-ivar">@last</span>, <span class="ruby-keyword kw">true</span>, <span class="ruby-keyword kw">false</span>) ; <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000563"></a><b>last_opened</b>()
+ <a name="M000561"></a><b>last_opened</b>()
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000563_source')" id="l_M000563_source">show source</a> ]</p>
- <div id="M000563_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000561_source')" id="l_M000561_source">+</a> ]</p>
+ <div id="M000561_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/more/facets/interval.rb, line 155</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">last_opened</span> ; <span class="ruby-constant">Interval</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@first</span>, <span class="ruby-ivar">@last</span>, <span class="ruby-keyword kw">false</span>, <span class="ruby-keyword kw">true</span>) ; <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000569"></a><b>length</b>()
+ <a name="M000567"></a><b>length</b>()
</div>
<div class="description">
<p>
-Alias for <a href="Interval.html#M000568">distance</a>
+Alias for <a href="Interval.html#M000566">distance</a>
</p>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000572"></a><b>max</b>()
+ <a name="M000570"></a><b>max</b>()
</div>
<div class="description">
<p>
-Returns the greater of the <a href="Interval.html#M000546">first</a> and <a
-href="Interval.html#M000547">last</a> sentinals.
+Returns the greater of the <a href="Interval.html#M000544">first</a> and <a
+href="Interval.html#M000545">last</a> sentinals.
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000572_source')" id="l_M000572_source">show source</a> ]</p>
- <div id="M000572_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000570_source')" id="l_M000570_source">+</a> ]</p>
+ <div id="M000570_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/more/facets/interval.rb, line 192</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">max</span>
((<span class="ruby-ivar">@first</span> <span class="ruby-operator"><=></span> <span class="ruby-ivar">@last</span>) <span class="ruby-operator">==</span> <span class="ruby-value">1</span>) <span class="ruby-operator">?</span> <span class="ruby-ivar">@first</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@last</span>
<span class="ruby-keyword kw">end</span>
@@ -711,31 +709,31 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000575"></a><b>member?</b>(x)
+ <a name="M000573"></a><b>member?</b>(x)
</div>
<div class="description">
<p>
Alias for include?
</p>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000571"></a><b>min</b>()
+ <a name="M000569"></a><b>min</b>()
</div>
<div class="description">
<p>
-Returns the lesser of the <a href="Interval.html#M000546">first</a> and <a
-href="Interval.html#M000547">last</a> sentinals.
+Returns the lesser of the <a href="Interval.html#M000544">first</a> and <a
+href="Interval.html#M000545">last</a> sentinals.
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000571_source')" id="l_M000571_source">show source</a> ]</p>
- <div id="M000571_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000569_source')" id="l_M000569_source">+</a> ]</p>
+ <div id="M000569_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/more/facets/interval.rb, line 187</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">min</span>
((<span class="ruby-ivar">@first</span> <span class="ruby-operator"><=></span> <span class="ruby-ivar">@last</span>) <span class="ruby-operator">==</span> <span class="ruby-value">-1</span>) <span class="ruby-operator">?</span> <span class="ruby-ivar">@first</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@last</span>
<span class="ruby-keyword kw">end</span>
@@ -743,67 +741,67 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000555"></a><b>null?</b>()
+ <a name="M000553"></a><b>null?</b>()
</div>
<div class="description">
<p>
Returns <tt>true</tt> if the start and <a
-href="Interval.html#M000551">end</a> <a
-href="Interval.html#M000545">sentinels</a> are equal and the interval is
+href="Interval.html#M000549">end</a> <a
+href="Interval.html#M000543">sentinels</a> are equal and the interval is
open; otherwise <tt>false</tt>.
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000555_source')" id="l_M000555_source">show source</a> ]</p>
- <div id="M000555_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000553_source')" id="l_M000553_source">+</a> ]</p>
+ <div id="M000553_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/more/facets/interval.rb, line 128</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">null?</span> ; <span class="ruby-ivar">@direction</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-keyword kw">and</span> <span class="ruby-ivar">@exclusive_first</span> <span class="ruby-keyword kw">and</span> <span class="ruby-ivar">@exclusive_last</span> ; <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000558"></a><b>opened</b>()
+ <a name="M000556"></a><b>opened</b>()
</div>
<div class="description">
<p>
-Returns a <a href="Interval.html#M000544">new</a> interval exclusive of
-both <a href="Interval.html#M000545">sentinels</a>.
+Returns a <a href="Interval.html#M000542">new</a> interval exclusive of
+both <a href="Interval.html#M000543">sentinels</a>.
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000558_source')" id="l_M000558_source">show source</a> ]</p>
- <div id="M000558_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000556_source')" id="l_M000556_source">+</a> ]</p>
+ <div id="M000556_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/more/facets/interval.rb, line 142</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">opened</span>; <span class="ruby-constant">Interval</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@first</span>, <span class="ruby-ivar">@last</span>, <span class="ruby-keyword kw">true</span>, <span class="ruby-keyword kw">true</span>) ; <span class="ruby-keyword kw">end</span>
</pre>
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000567"></a><b>reversed</b>()
+ <a name="M000565"></a><b>reversed</b>()
</div>
<div class="description">
<p>
-Returns a <a href="Interval.html#M000544">new</a> interval with the <a
-href="Interval.html#M000545">sentinels</a> <a
-href="Interval.html#M000567">reversed</a>.
+Returns a <a href="Interval.html#M000542">new</a> interval with the <a
+href="Interval.html#M000543">sentinels</a> <a
+href="Interval.html#M000565">reversed</a>.
</p>
<pre>
(0..10).reversed #=> 10..0
</pre>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000567_source')" id="l_M000567_source">show source</a> ]</p>
- <div id="M000567_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000565_source')" id="l_M000565_source">+</a> ]</p>
+ <div id="M000565_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/more/facets/interval.rb, line 167</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reversed</span>
<span class="ruby-constant">Interval</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@last</span>, <span class="ruby-ivar">@first</span>, <span class="ruby-keyword kw">true</span>, <span class="ruby-keyword kw">true</span>)
<span class="ruby-keyword kw">end</span>
@@ -811,25 +809,25 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000545"></a><b>sentinels</b>()
+ <a name="M000543"></a><b>sentinels</b>()
</div>
<div class="description">
<p>
-Returns a two element array of <a href="Interval.html#M000546">first</a>
-and <a href="Interval.html#M000547">last</a> <a
-href="Interval.html#M000545">sentinels</a>.
+Returns a two element array of <a href="Interval.html#M000544">first</a>
+and <a href="Interval.html#M000545">last</a> <a
+href="Interval.html#M000543">sentinels</a>.
</p>
<pre>
(0..10).sentinels #=> [0,10]
</pre>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000545_source')" id="l_M000545_source">show source</a> ]</p>
- <div id="M000545_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000543_source')" id="l_M000543_source">+</a> ]</p>
+ <div id="M000543_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/more/facets/interval.rb, line 106</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sentinels</span>
<span class="ruby-keyword kw">return</span> [<span class="ruby-ivar">@first</span>, <span class="ruby-ivar">@last</span>]
<span class="ruby-keyword kw">end</span>
@@ -837,34 +835,34 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000570"></a><b>size</b>()
+ <a name="M000568"></a><b>size</b>()
</div>
<div class="description">
<p>
-Alias for <a href="Interval.html#M000568">distance</a>
+Alias for <a href="Interval.html#M000566">distance</a>
</p>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000577"></a><b>step</b>(n=1, d=nil)
+ <a name="M000575"></a><b>step</b>(n=1, d=nil)
</div>
<div class="description">
<p>
-Alias for <a href="Interval.html#M000576">each</a>
+Alias for <a href="Interval.html#M000574">each</a>
</p>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000566"></a><b>~</b>()
+ <a name="M000564"></a><b>~</b>()
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000566_source')" id="l_M000566_source">show source</a> ]</p>
- <div id="M000566_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000564_source')" id="l_M000564_source">+</a> ]</p>
+ <div id="M000564_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/more/facets/interval.rb, line 161</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">~@</span> ; <span class="ruby-constant">Interval</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">first</span>, <span class="ruby-identifier">last</span>, <span class="ruby-keyword kw">true</span>, <span class="ruby-keyword kw">true</span>) ; <span class="ruby-keyword kw">end</span>
</pre>
</div>
\ No newline at end of file