From: Robert Dober Date: 2007-05-30T22:34:03+09:00 Subject: Re: #respond_to? not working for dynamically generated metho On 5/30/07, James Edward Gray II wrote: > On May 30, 2007, at 7:53 AM, dblack@wobblini.net wrote: > > > You could of course shoehorn find_by_* into respond_to? for AR > > objects, if you don't mind, essentially, writing method_missing twice > > (once for real, once as a kind of pseudo-static twin). > > I don't really understand this stance. My opinion is that providing > a method_missing() implementation is a convenient way for a > programmer to define a lot of dynamic methods. This increases the > messages an object responds to. I have always felt that dynamic method creation and dynamic message interception are not quite the same beast. But I guess you have some thoughts behind your claim of which I fail to grasp the concept. Would you mind to elaborate? To be honest, with my lack of imagination, right now I really do not like the idea to tweak #respond_to? . Am I right that in the following case class A def method_missing name, *args, &blk return whatever(name, *args, &blk) end end A.new.respond_to(x) would be true for whatever x - if it were for your idea. Is this really a good idea? Cheers Robert > Those are just my opinions though. Same here :) > > James Edward Gray II > > > Robert -- You see things; and you say Why? But I dream things that never were; and I say Why not? -- George Bernard Shaw