[DOC] Combine docs for Method#call aliases

RDoc does not parse the documentation for the Method#call aliases, so we
should combine the aliases into one documentation.
This commit is contained in:
Peter Zhu 2025-12-22 11:51:04 -05:00
parent ab565a3e0d
commit d517e04806
Notes: git 2025-12-23 14:00:34 +00:00

43
proc.c
View File

@ -2642,13 +2642,20 @@ method_dup(VALUE self)
return clone;
}
/* Document-method: Method#===
*
/*
* call-seq:
* method === obj -> result_of_method
* meth.call(args, ...) -> obj
* meth[args, ...] -> obj
* method === obj -> result_of_method
*
* Invokes the method with +obj+ as the parameter like #call.
* This allows a method object to be the target of a +when+ clause
* Invokes the <i>meth</i> with the specified arguments, returning the
* method's return value.
*
* m = 12.method("+")
* m.call(3) #=> 15
* m.call(20) #=> 32
*
* Using Method#=== allows a method object to be the target of a +when+ clause
* in a case statement.
*
* require 'prime'
@ -2659,32 +2666,6 @@ method_dup(VALUE self)
* end
*/
/* 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
*
* Invokes the <i>meth</i> with the specified arguments, returning the
* method's return value.
*
* m = 12.method("+")
* m.call(3) #=> 15
* m.call(20) #=> 32
*/
static VALUE
rb_method_call_pass_called_kw(int argc, const VALUE *argv, VALUE method)
{