From: "Bartosz DziewoƄski" Date: 2012-04-28T21:45:40+09:00 Subject: Re: list local_variables in a def by means of a method Like this: -------- class A def stuff a = 4 foo = 'asd' list_vars(binding()) end def list_vars bnd bnd.eval('local_variables').each{|var| puts "#{var} is #{bnd.eval(var.to_s).class} and is equal to #{bnd.eval(var.to_s).inspect}" } end end A.new.stuff -------- This will print: a is Fixnum and is equal to 4 foo is String and is equal to "asd" The method "binding" will return a magical value that basically contains the entire state of a script in this particular place. You can then eval code as if it appeared in that place, and you will have access to all variables available there. -- Matma Rex