summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-04-24 11:10:44 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-04-24 11:18:27 +0900
commitcf90df22c74da2f87421749e8d065cfbd3812afd (patch)
tree6322b2faa7c41391d205d21eaf3e551680e15aca /proc.c
parentac2106acc276854ae2ac8cc5fa6859aa28362f2f (diff)
[DOC] Separated Method#[] from Method#call [Bug #16813] [ci skip]
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/proc.c b/proc.c
index e92746915e..38d4fc6bf7 100644
--- a/proc.c
+++ b/proc.c
@@ -2271,10 +2271,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.