method

local_variables

v1_8_7_72 - 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"]