Skip to content

Instantly share code, notes, and snippets.

@badosu
Created June 11, 2013 16:47
Show Gist options
  • Save badosu/5758507 to your computer and use it in GitHub Desktop.
Save badosu/5758507 to your computer and use it in GitHub Desktop.
x = 10
def hi
frame = JRuby.runtime.current_context.frames(0)[1]
puts frame.send('binding').eval('x')
end
hi
# => 10
@banister
Copy link

Does that allow access to frames arbitrarily far up the stack? or just to the immediate caller?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment