Skip to content

Commit d517e04

Browse files
committed
[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.
1 parent ab565a3 commit d517e04

File tree

1 file changed

+12
-31
lines changed

1 file changed

+12
-31
lines changed

proc.c

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2642,13 +2642,20 @@ method_dup(VALUE self)
26422642
return clone;
26432643
}
26442644

2645-
/* Document-method: Method#===
2646-
*
2645+
/*
26472646
* call-seq:
2648-
* method === obj -> result_of_method
2647+
* meth.call(args, ...) -> obj
2648+
* meth[args, ...] -> obj
2649+
* method === obj -> result_of_method
2650+
*
2651+
* Invokes the <i>meth</i> with the specified arguments, returning the
2652+
* method's return value.
26492653
*
2650-
* Invokes the method with +obj+ as the parameter like #call.
2651-
* This allows a method object to be the target of a +when+ clause
2654+
* m = 12.method("+")
2655+
* m.call(3) #=> 15
2656+
* m.call(20) #=> 32
2657+
*
2658+
* Using Method#=== allows a method object to be the target of a +when+ clause
26522659
* in a case statement.
26532660
*
26542661
* require 'prime'
@@ -2659,32 +2666,6 @@ method_dup(VALUE self)
26592666
* end
26602667
*/
26612668

2662-
2663-
/* Document-method: Method#[]
2664-
*
2665-
* call-seq:
2666-
* meth[args, ...] -> obj
2667-
*
2668-
* Invokes the <i>meth</i> with the specified arguments, returning the
2669-
* method's return value, like #call.
2670-
*
2671-
* m = 12.method("+")
2672-
* m[3] #=> 15
2673-
* m[20] #=> 32
2674-
*/
2675-
2676-
/*
2677-
* call-seq:
2678-
* meth.call(args, ...) -> obj
2679-
*
2680-
* Invokes the <i>meth</i> with the specified arguments, returning the
2681-
* method's return value.
2682-
*
2683-
* m = 12.method("+")
2684-
* m.call(3) #=> 15
2685-
* m.call(20) #=> 32
2686-
*/
2687-
26882669
static VALUE
26892670
rb_method_call_pass_called_kw(int argc, const VALUE *argv, VALUE method)
26902671
{

0 commit comments

Comments
 (0)