method

local_variables

v2_6_3 - Show latest stable - Class: Kernel
local_variables()
public

Returns the names of the current local variables.

fred = 1
for i in 1..10
   # ...
end
local_variables   #=> [:fred, :i]