End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Method#call
meth.call(args, ...) → obj
proc.c
View on GitHub ↗
static VALUE
rb_method_call_pass_called_kw(int argc, const VALUE *argv, VALUE method)
{
VALUE procval = rb_block_given_p() ? rb_block_proc() : Qnil;
return rb_method_call_with_block_kw(argc, argv, method, procval, RB_PASS_CALLED_KEYWORDS);
}
Invokes the meth with the specified arguments, returning the method’s return value.
Example
m = 12.method("+") m.call(3) #=> 15 m.call(20) #=> 32