diff --git a/eval.c b/eval.c index e9b720b67d..eda872dc38 100644 --- a/eval.c +++ b/eval.c @@ -7892,6 +7892,22 @@ rb_f_binding(self) return bind; } +/* + * call-seq: + * binding.eval(string [, filename [,lineno]]) => obj + * + * 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" + */ + static VALUE bind_eval(argc, argv, bind) int argc;