method

local_variable_get

v2_1_10 - Show latest stable - Class: Binding
local_variable_get(p1)
public

Returns a value of local variable symbol.

def foo
  a = 1
  binding.local_variable_get(:a) #=> 1
  binding.local_variable_get(:b) #=> NameError
end

This method is short version of the following code.

binding.eval("#{symbol}")