Flowdock
method

local_variable_get

Importance_1
v2_4_6 - Show latest stable - 0 notes - Class: Binding
local_variable_get(p1) public

Returns the value of the local variable symbol.

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

This method is the short version of the following code:

binding.eval("#{symbol}")
Show source
Register or log in to add new notes.