eval

binding.eval(string [, filename [,lineno]]) รข obj
Instance Public methods

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)
  return binding
end
b = get_binding("hello")
b.eval("param")   #=> "hello"
doc_ruby_on_rails
2015-03-31 13:11:14
Comments
Leave a Comment

Please login to continue.