binding

binding รข a_binding
Instance Public methods

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. See also the description of class Binding.

def get_binding(param)
  return binding
end
b = get_binding("hello")
eval("param", b)   #=> "hello"
doc_ruby_on_rails
2015-04-17 09:11:34
Comments
Leave a Comment

Please login to continue.