APIdock / Ruby
/
method

__method__

ruby latest stable - Class: Kernel
__method__()
public

Returns the name at the definition of the current method as a Symbol. If called outside of a method, it returns nil.

static VALUE
rb_f_method_name(void)
{
 ID fname = prev_frame_func(); /* need *method* ID */
 if (fname) {
 return ID2SYM(fname);
 }
 else {
 return Qnil;
 }
}

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