From: Shyouhei Urabe Date: 2009-07-31T06:16:13+09:00 Subject: [ruby-core:24625] [Bug #1844] Immediates Should Not Respond to :dup Issue #1844 has been updated by Shyouhei Urabe. # This is a bit radical opinion, I admit. From my point of view, "determining" whether an object has a method is a wrong idea. Instead you should just call that method. Which is: begin obj.method rescue ... end instead of: if obj.respond_to? :method then obj.method else ... end Why you should avoid respond_to? is that it is nothing special; just a method which can be overridden. So respond_to? is sometimes not realiable for various reasons. If you want to make sure, the safest way is to see if it actually quacks like a duck. ---------------------------------------- http://redmine.ruby-lang.org/issues/show/1844 ---------------------------------------- http://redmine.ruby-lang.org