From: Florian Gilcher Date: 2008-06-14T23:05:13+09:00 Subject: Re: fire event when the value of a variable is changed -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Jun 14, 2008, at 3:07 PM, Mehdi Adda wrote: > Tobias Weber wrote: >> In article , >> Mehdi Adda wrote: >> >>> I have told that if the value of the variable is changed via a >>> sitter, >>> it's possible to use a method chaining. How if there is no setter ? >> >> What kind of variable? Global, local, instance? For the latter you >> could >> write your own attr_accessor method that either creates a call to a >> custom method or uses update() of Observer. > > Thanks for the answer ... if fact when it's an instance variable, it's > possible to (re)define the setter... the problem is when the > variable is > local. > > > I checked the use of trace_var, and as Avdi said, it's only used to > trace global variables assignments. > > > Addame Even if you change the setter, you won't be able to trace direct assignment. Regards, Florian Gilcher -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) iEYEARECAAYFAkhT0DsACgkQJA/zY0IIRZZtMQCcDXUu3UKxEiOi9ixEW3J5LUKr TaoAoIXU3Dom1cDnzGCoOUmRI0Lt/XDl =SYa5 -----END PGP SIGNATURE-----