meth.arity â fixnum
Instance Public methods
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.
class C
def one; end
def two(a); end
def three(*a); end
def four(a, b