From: Yusuke ENDOH Date: 2010-05-27T17:38:51+09:00 Subject: [ruby-core:30453] Re: [Bug #3350] Protected methods & documentation Hi, 2010/5/27 Marc-Andre Lafortune : > Should I change the doc to reflect the current behavior, as per the patch below? Agreed. It is more honest. > I'm curious: what examples exist where one would want to match public and protected methods but not private ones? Because whether protected methods can be called are context-sensitive. Consider this: class X def protected_method; end protected :protected_method def foo X.new.protected_method # succeed to call X.new.methods.include?(:protected_method) #=> true (as expected) end end X.new.foo If Object#methods returns only public methods, the above expectation is not satisfied. 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. -- Yusuke Endoh