binding() public

Returns a Binding object, describing the variable and method bindings at the point of call. This object can be used when calling eval to execute the evaluated command in this environment. Also see the description of class Binding.

def getBinding(param)
  return binding
end
b = getBinding("hello")
eval("param", b)   #=> "hello"
Show source
Register or log in to add new notes.