From: Avdi Grimm Date: 2008-06-14T12:36:13+09:00 Subject: Re: fire event when the value of a variable is changed On Fri, Jun 13, 2008 at 10:04 PM, fedzor wrote: > a = 5 > a.trace_var {|new| puts "a was changed to '#{new}'" } Did you actually try this? And if so, on what version of Ruby? According to RI and the results of my own experimentation, trace_var is called like so: trace_var(:$a) {|value| ...} And it only works for globals, not local variables. -- Avdi Home: http://avdi.org Developer Blog: http://avdi.org/devblog/ Twitter: http://twitter.com/avdi Journal: http://avdi.livejournal.com