instance methods
|
[ ] |
meth[ [args]* ]
-> anObject
|
|
Synonym for Method.call .
| arity |
meth.arity -> aFixnum
|
|
Returns an indication of the number of arguments accepted by a method.
Returns a nonnegative integer for methods that take a fixed number
of arguments. For Ruby methods that take a variable number of
arguments, returns -n-1, where n is the number of required
arguments. For methods written in C, returns -1 if the call
takes a variable number of arguments.
| call |
meth.call( [args]* )
-> anObject
|
|
Invokes the meth with the specified
arguments, returning the method's return value.
m = 12.method("+") |
m.call(3) |
» |
15 |
m.call(20) |
» |
32 |
| to_proc |
meth.to_proc -> aProc
|
|
Returns a Proc object corresponding to this method.
|