From: Avi Bryant Date: 2001-11-06T06:37:08+09:00 Subject: [ruby-talk:24429] Re: Detect future method calls in method_mi ssing? On Tue, 6 Nov 2001, Morris, Chris wrote: > I'm wrapping dom nodes. Form element dom nodes. I'm wrapping them so my > customer can script his own tests. Most of the time the script writer needs > to simply set the value of a form element, but a straight call requires > setting the .value property: > > form.anElement.value = blergh > > I wrapped this so the script writer would not have to remember .value all > the time: > > form.anElement = blergh > > What I do is intercept anElement and re-route the call to anElement.value. > Works great. But this is actually a call to anElement=, right? It seems like you could reroute anElement= without touching calls to anElement... That is, you have form.anElement = blergh #equiv to form.send(:anElement=, blergh) form.anElement.checked = true #equiv to form.anElement.send(:checked=, true) and I don't see why those would ever get confused with each other.