__method__()
public
Returns the name at the definition of the current method as a Symbol. If called outside of a method, it returns
nil.
Show source
static VALUE
rb_f_method_name(void)
{
ID fname = prev_frame_func(); /* need *method* ID */
if (fname) {
return ID2SYM(fname);
}
else {
return Qnil;
}
}