aboutsummaryrefslogtreecommitdiffstats
path: root/proc.c
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2020-06-07 12:04:23 +0900
committernagachika <nagachika@ruby-lang.org>2020-06-07 12:04:23 +0900
commit16aef5da5622971ae83dcc281b03a53c5f622ca3 (patch)
tree1d0e514873639f9944aa588a4774b2ed2d615313 /proc.c
parenta0c7c23c9cec0d0ffcba012279cd652d28ad5bf3 (diff)
downloadruby-16aef5da5622971ae83dcc281b03a53c5f622ca3.tar.gz
merge revision(s) ac2106acc276854ae2ac8cc5fa6859aa28362f2f,cf90df22c74da2f87421749e8d065cfbd3812afd: [Backport #16813]
[DOC] Fixed explanation for Method#>> [Bug #16813] [ci skip] [DOC] Separated Method#[] from Method#call [Bug #16813] [ci skip]
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/proc.c b/proc.c
index deffe1fc06..020505ae72 100644
--- a/proc.c
+++ b/proc.c
@@ -2230,10 +2230,22 @@ method_clone(VALUE self)
*/
+/* Document-method: Method#[]
+ *
+ * call-seq:
+ * meth[args, ...] -> obj
+ *
+ * Invokes the <i>meth</i> with the specified arguments, returning the
+ * method's return value, like #call.
+ *
+ * m = 12.method("+")
+ * m[3] #=> 15
+ * m[20] #=> 32
+ */
+
/*
* call-seq:
* meth.call(args, ...) -> obj
- * meth[args, ...] -> obj
*
* Invokes the <i>meth</i> with the specified arguments, returning the
* method's return value.
@@ -3479,8 +3491,8 @@ rb_method_compose_to_left(VALUE self, VALUE g)
* meth >> g -> a_proc
*
* Returns a proc that is the composition of this method and the given <i>g</i>.
- * The returned proc takes a variable number of arguments, calls <i>g</i> with them
- * then calls this method with the result.
+ * The returned proc takes a variable number of arguments, calls this method
+ * with them then calls <i>g</i> with the result.
*
* def f(x)
* x * x