Why do we need #respond_to_missing?

Greg Navis <[email protected]>
Newsgroups gmane.comp.lang.ruby.general
Message-ID <CAA6WWt_fD4_9Z79=aR4uLD9rETfm1F48=gXavih-3f_j8ntVVw@mail.gmail.com>
Hi!

I was wondering why do we need #respond_to_missing? as a separate method. I
tried searching for a rationale in the Ruby bug tracker but couldn't find
it.

I don't understand how it's different from overriding #respond_to? to match
dynamic methods and calling super on other matches.

The answer I'm NOT looking for is that #method wouldn't work, etc. as this
is an answer to a different question ("Why do I need to override
#respond_to_missing?").

Why was Ruby designed in a way that introduces a distinction between
#respond_to? and #respond_to_missing? It feels like I'm overlooking
something simple.

Best regards
Greg Navis


Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.