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
.
2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 |
# File 'eval.c', line 2009
static VALUE
rb_f_callee_name(VALUE _)
{
ID fname = prev_frame_callee(); /* need *callee* ID */
if (fname) {
return ID2SYM(fname);
}
else {
return Qnil;
}
}
|