Skip to content

Instantly share code, notes, and snippets.

@mchung
Created August 25, 2008 19:01
Show Gist options
  • Save mchung/7138 to your computer and use it in GitHub Desktop.
Save mchung/7138 to your computer and use it in GitHub Desktop.
stargate:rb mchung$ cat binding.rb
# Return bindings
def f
a = 42
b = "foo"
binding
end
f_vars = f()
p eval("a", f_vars)
p eval("b", f_vars)
stargate:rb mchung$ ruby binding.rb
42
"foo"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment