I try to get the name of the method from which current method is called
def first_method
my_method
end
def second_method
my_method
end
def my_method
puts "called from: #{method_name}"
end
and expected output:
"called from: first_method"
"called from: last_method"