In Ruby, one can use either
__callee__
or
__method__
to find the name of the currently executing method.<
__method__ returns defined name, and __callee__ returns called name. They are same usually, but different in a aliased method.
def foo [__method__, __callee__] end alias bar foo p foo #=> [:foo, :foo] p bar #=> [:foo, :bar]
link