Created
June 11, 2013 16:47
-
-
Save badosu/5758507 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = 10 | |
def hi | |
frame = JRuby.runtime.current_context.frames(0)[1] | |
puts frame.send('binding').eval('x') | |
end | |
hi | |
# => 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does that allow access to frames arbitrarily far up the stack? or just to the immediate caller?