On Wed, Jun 06, 2001 at 07:41:16PM +0200, ts wrote: > >>>>> "P" == Patrik Sundberg <ps / radiac.mine.nu> writes: > > P> in the RbObjGwHandle#method_missing method where I placed the comment gets > P> just hangs. that is @gw.send(:gets) hangs, but if i change this to @gw.gets i > P> am alright. anyone have an explanation for this? > > Well, it don't really hang, because it wait for input from the > keyboard. In reality it call Kernel#gets. that was what i meant yes. > When you call > > @gw.send(:gets) > > ruby look if it exist a method with this name defined for this object, and > it find it. This is the *private* method Kernel#gets, then it just call this > method. hmm.. ok. but doesn't undef :gets undefine every occurance of gets from the class - private as well as public? > When you call > > @gw.gets > > ruby make the same search, it find the *private* method Kernel#gets and it > reject this call because you have called #gets like a *public* method (this > was not the case with #send). > > At this step, it call #method_missing of @gw which send the command to the > server. ok - so is there any other solution than using eval("@gw."+methId.to_s) ? using eval i seem to end up in Kernel#gets if I don't undef :gets in the server class. I still don't really get this.. -- -----------------------------------------------------------. Patrik Sundberg email: ps / raditex.se || ps / radiac.mine.nu | Phone: +46 13 178567 || +46 707 602240 | .---> UNIX consultant | |-----> Applied Physics and Electrical Engineering student | `----------------------------------------------------------'