I want to get stack depth, to know how deep it go in recursive function.
I found How do I get the current depth of the Python interpreter stack? this, and this is what exactly I want, but it's python, and I couldn't find anything like this when I googled 'Ruby get stack depth'.
What I want to do is something like this:
def recursive_func(n)
if n == 1
return get_current_depth()
end
recursive_func(n - 1)
end
What can I use?