Method: Kernel#binding

Defined in:
proc.c

#bindingBinding

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)
  binding
end
b = get_binding("hello")
eval("param", b)   #=> "hello"

Returns:

[View source]

386
387
388
389
390
# File 'proc.c', line 386

static VALUE
rb_f_binding(VALUE self)
{
    return rb_binding_new();
}