How to check if instance variable value have changed?
For global variable there is a trace_var method
http://apidock.com/ruby/Kernel/trace_var
But I didn’t found any information how to do that with instance variables(or class one).
I didn’t use Rails.
Ruby 1.9.2.
The best approach might be to avoid accessing and manipulating the instance variable directly and instead go through an
attr_accessorstyle interface.This gives you the ability to do things like this: