From: "Wolfgang Nádasi-Donner" Date: 2007-11-18T02:56:53+09:00 Subject: Re: Observe variable set and variable change unknown wrote: > a way for also tracing vars inside methods. > > def x() > z = 10 > z = 42 > end I don't think that there exists some method for this purpose. You can use Ruby's trace possibilities or a simple method for looking at local variables at special points... def show_local_vars(bind, *d) puts '----- variables -----' vars = eval("local_variables", bind) (d.length == 0 ? vars : (d.map{|s|s.to_s} & vars)).each do |v| begin puts "#{v}=#{eval(v,bind)}" rescue puts "+++++ Variable '#{v}' not defined" end end end def x() z = 10 show_local_vars(binding) z = 42 show_local_vars(binding, :z, :a) end x ...outputs... ----- variables ----- z=10 ----- variables ----- z=42 Wolfgang Nádasi-Donner -- Posted via http://www.ruby-forum.com/.