APIdock / Ruby
/
method

to_proc

ruby latest stable - Class: Method
to_proc()
public

Returns a Proc object corresponding to this method.

static VALUE
method_to_proc(VALUE method)
{
 VALUE procval;
 rb_proc_t *proc;
 /*
 * class Method
 * def to_proc
 * lambda{|*args|
 * self.call(*args)
 * }
 * end
 * end
 */
 procval = rb_iterate(mlambda, 0, bmcall, method);
 GetProcPtr(procval, proc);
 proc->is_from_method = 1;
 return procval;
}

AltStyle によって変換されたページ (->オリジナル) /