method

eval

v2_6_3 - Show latest stable - Class: Binding
eval(p1, p2 = v2, p3 = v3)
public

Evaluates the Ruby expression(s) in string, in the binding’s context. If the optional filename and lineno parameters are present, they will be used when reporting syntax errors.

def get_binding(param)
  binding
end
b = get_binding("hello")
b.eval("param")   #=> "hello"