pub unsafe extern "C" fn rb_obj_method(
recv: VALUE,
mid: VALUE,
) -> VALUEExpand description
Creates a method object. A method object is a proc-like object that you can “call”. Note that a method object snapshots the method at the time the object is created:
class Foo
def foo
return 1
end
end
obj = Foo.new.method(:foo)
class Foo
def foo
return 2
end
end
obj.call # => 1, not 2.§@param[in] recv Receiver of the method.
@param[in] mid Method name, in either String or Symbol.
@exception rb_eNoMethodError No such method.
@return An instance of ::rb_cMethod.
Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.2.3