From: dblack@... Date: 2007-05-31T00:01:44+09:00 Subject: Re: #respond_to? not working for dynamically generated metho Hi -- On Wed, 30 May 2007, Tim Hunter wrote: > James Gray wrote: >> >> 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. >> >> Following from that logic, I believe you should also override >> respond_to?() to reflect those new messages. It's my opinion >> therefore that this thread has exposed a bug in Rails that should be >> patched. >> > > FWIW, there's an entry about this in the Ruby Style Guide on > rubygarden.org: > http://wiki.rubygarden.org/Ruby/page/show/RubyStyleGuide/RespondToGoesWithMethodMissing Hmmm... perhaps there needs to be a second entry explaining why it's better not to put oneself in the position of having to maintain two almost identical methods in parallel instead of one :-) David -- Q. What is THE Ruby book for Rails developers? A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black) (See what readers are saying! http://www.rubypal.com/r4rrevs.pdf) Q. Where can I get Ruby/Rails on-site training, consulting, coaching? A. Ruby Power and Light, LLC (http://www.rubypal.com)