doc/rdoc/core/classes/UnboundMethod.html in facets-2.5.0 vs doc/rdoc/core/classes/UnboundMethod.html in facets-2.5.1
- old
+ new
@@ -80,26 +80,26 @@
<div class="sectiontitle">Methods</div>
- <span style="padding-right: 5px;"><a href="#M000315">arguments</a></span>
- <span style="padding-right: 5px;"><a href="#M000314">name</a></span>
+ <span style="padding-right: 5px;"><a href="#M000327">arguments</a></span>
+ <span style="padding-right: 5px;"><a href="#M000326">name</a></span>
<div class="sectiontitle">Public Instance methods</div>
<div class="method">
<div class="title">
- <a name="M000315"></a><b>arguments</b>()
+ <a name="M000327"></a><b>arguments</b>()
</div>
<div class="description">
<p>
-Resolves the <a href="UnboundMethod.html#M000315">arguments</a> of the
+Resolves the <a href="UnboundMethod.html#M000327">arguments</a> of the
method to have an identical signiture —useful for preserving arity.
</p>
<pre>
class X
def foo(a, b); end
@@ -112,20 +112,20 @@
bar_method = X.instance_method(:bar)
bar_method.arguments #=> "a0, *args"
</pre>
<p>
When defaults are used the <a
-href="UnboundMethod.html#M000315">arguments</a> must end in
+href="UnboundMethod.html#M000327">arguments</a> must end in
"*args".
</p>
<p>
CREDIT: Trans
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000315_source')" id="l_M000315_source">+</a> ]</p>
- <div id="M000315_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000327_source')" id="l_M000327_source">+</a> ]</p>
+ <div id="M000327_source" class="dyn-source">
<pre>
<span class="ruby-comment cmt"># File lib/core/facets/unboundmethod/arguments.rb, line 21</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">arguments</span>
<span class="ruby-identifier">ar</span> = <span class="ruby-identifier">arity</span>
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">ar</span> <span class="ruby-operator"><=></span> <span class="ruby-value">0</span>
@@ -152,17 +152,22 @@
</div>
</div>
</div>
<div class="method">
<div class="title">
- <a name="M000314"></a><b>name</b>()
+ <a name="M000326"></a><b>name</b>()
</div>
<div class="description">
<p>
-Return the <a href="UnboundMethod.html#M000314">name</a> of the method. Is
-this already in 1.9+ ?
+Return the <a href="UnboundMethod.html#M000326">name</a> of the method.
</p>
+<p>
+Be aware that in ruby 1.9 <a
+href="UnboundMethod.html#M000326">UnboundMethod#name</a> is defined
+already, but it returns a <a href="Symbol.html">Symbol</a> not a <a
+href="String.html">String</a>.
+</p>
<pre>
class X
def foo; end
end
@@ -173,13 +178,13 @@
<p>
CREDIT: Trans
</p>
</div>
<div class="sourcecode">
- <p class="source-link">[ <a href="javascript:toggleSource('M000314_source')" id="l_M000314_source">+</a> ]</p>
- <div id="M000314_source" class="dyn-source">
+ <p class="source-link">[ <a href="javascript:toggleSource('M000326_source')" id="l_M000326_source">+</a> ]</p>
+ <div id="M000326_source" class="dyn-source">
<pre>
-<span class="ruby-comment cmt"># File lib/core/facets/unboundmethod/name.rb, line 18</span>
+<span class="ruby-comment cmt"># File lib/core/facets/unboundmethod/name.rb, line 20</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">name</span>
<span class="ruby-identifier">i</span> = <span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">rindex</span>(<span class="ruby-value str">'#'</span>)
<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">slice</span>(<span class="ruby-identifier">i</span><span class="ruby-operator">+</span><span class="ruby-value">1</span><span class="ruby-operator">...</span><span class="ruby-value">-1</span>)
<span class="ruby-keyword kw">end</span>
</pre>
\ No newline at end of file