Skip to content

Instantly share code, notes, and snippets.

@edthix
Created October 23, 2009 12:15
Show Gist options
  • Save edthix/216837 to your computer and use it in GitHub Desktop.
Save edthix/216837 to your computer and use it in GitHub Desktop.
Ruby bindings with robots!
def robot_internals
arm = "mechanical hydraulics"
return binding
end
binded = robot_internals
arm = "five fingers"
eval "puts arm" # five fingers
eval "puts arm", binded # mechanical hydraulics
eval "arm += ' and not enough'"
eval "puts arm" # five fingers and not enough
eval "puts arm", binded # mechanical hydraulics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment