From: Paul Brannan Date: 2001-12-18T02:39:14+09:00 Subject: [ruby-talk:28811] Re: Tracing instance variables On Tue, Dec 18, 2001 at 01:51:16AM +0900, Jason Voegele wrote: > Is there a better way to do this? I know that global variables can be > traced for modification. Is there some way to trace instance variables as > well, either in standard Ruby or any existing library? I'm already using > AspectR for the binding, but I don't think it supports tracing instance > variables. You can trace assignments to global variables, but you cannot trace modifications of globals. E.g.: trace_var :$foo, proc { |x| p x } $foo = "foo" $foo.sub!('f', 'b') will print "foo" when the assignment is made, but will not print "boo" when the modification is done. Paul