Method: Binding#eval
- Defined in:
- eval.c
#eval(string[, filename [,lineno]]) ⇒ Object
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 getBinding(param)
return binding
end
b = getBinding("hello")
b.eval("param") #=> "hello"
8619 8620 8621 |
# File 'eval.c', line 8619 static VALUE bind_eval(argc, argv, bindval) int argc; |