문제

Can I get current level of stack in Ruby?

Currently I use caller.size which is ok, but looks not native

도움이 되었습니까?

해결책

caller.size is pretty much exactly what you want, since it is fairly standard, widely implemented, and gives you the number of frames on the stack. It is a native function on MRI, and most other interpreters.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top