Method: Kernel#__callee__

Defined in:
eval.c

#__callee__Object

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



1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
# File 'eval.c', line 1957

static VALUE
rb_f_callee_name(VALUE _)
{
    ID fname = prev_frame_callee(); /* need *callee* ID */

    if (fname) {
	return ID2SYM(fname);
    }
    else {
	return Qnil;
    }
}