owner

meth.owner â class_or_module Instance Public methods Returns the class or module that defines the method.

name

meth.name â symbol Instance Public methods Returns the name of the method.

inspect

meth.inspect â string Instance Public methods Returns the name of the underlying method. "cat".method(:count).inspect #=> "#<Method: String#count>"

hash

meth.hash â integer Instance Public methods Returns a hash value corresponding to the method object.

eql?

meth == other_meth â true or false Instance Public methods Two method objects are equal if they are bound to the same object and refer to the same method definition and their owners are the same class or module.

clone

method.clone â new_method Instance Public methods Returns a clone of this method. class A def foo return "bar" end end m = A.new.method(:foo) m.call # => "bar" n = m.clone.call # => "bar"

call

meth.call(args, ...) â obj Instance Public methods Invokes the meth with the specified arguments, returning the method's return value. m = 12.method("+") m.call(3) #=> 15 m.call(20) #=> 32

arity

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

[]

meth[args, ...] â obj Instance Public methods Invokes the meth with the specified arguments, returning the method's return value. m = 12.method("+") m.call(3) #=> 15 m.call(20) #=> 32

==

meth == other_meth â true or false Instance Public methods Two method objects are equal if they are bound to the same object and refer to the same method definition and their owners are the same class or module.