From: dblack@... Date: 2006-06-05T20:53:06+09:00 Subject: Re: Why doesn't method_missing affect respond_to? Hi -- On Mon, 5 Jun 2006, Pat Maddox wrote: > Take this class: > > class Foo > def method_missing(m, *args) > m.to_s > end > end > > irb(main):006:0> Foo.new.foo > => "foo" > irb(main):007:0> Foo.respond_to? :foo > => false > > This obviously just returns the name of any method that doesn't exist > for the object. So if you can send the object any message and get a > result, why doesn't it respond_to those messages? Maybe because that would render #respond_to? essentially useless :-) David -- David A. Black (dblack@wobblini.net) * Ruby Power and Light, LLC (http://www.rubypowerandlight.com) > Ruby and Rails consultancy and training * Author of "Ruby for Rails" from Manning Publications! > http://www.manning.com/black