From: Marc-Andre Lafortune Date: 2010-06-22T13:43:59+09:00 Subject: [ruby-core:30849] Re: [Bug #3350] Protected methods & documentation Hi, On Thu, May 27, 2010 at 4:38 AM, Yusuke ENDOH wrote: > Because whether protected methods can be called are context-sensitive. > ... > Object#methods may be also context-sensitive (IOW, Object#methods > returns different results depending on where it is called), but the > behavior is more difficult (for me) to understand than current one. Sorry for the delay. Yes, I agree with all this. I still wonder what actual cases exist where one wants to call respond_to? and get true on a protected method. I would assume that you usually know what objects of your class respond to and that you typically do not need to use duck typing this way. On the other hand, other classes know nothing in general about your classes and in cases of duck typing can be confused by a protected method that they can't actually call. I think that obj.respond_to?(:foo) should return false even if obj has a protected method foo.