method
local_variables
v2_6_3 -
Show latest stable
- Class:
Binding
local_variables()public
Returns the names of the binding’s local variables as symbols.
def foo a = 1 2.times do |n| binding.local_variables #=> [:a, :n] end end
This method is the short version of the following code:
binding.eval("local_variables")