On Mon, 29 Aug 2005, Malte Milatz wrote: > David A. Black wrote: >> irb(main):008:0> class C; def x; 1; end; private :x; end => C >> irb(main):009:0> class C; def method_missing(m); p m; end; end => nil >> irb(main):010:0> C.new.x >> :x >> should give a "private method 'x'" error. >> >> Then again, that's actually a NoMethodError.... Maybe it should be a >> UnavailableMethodError or something. > > In my opinion, an object shouldn't tell others about its internals unless > explicitly asked. So a NoMethodError is OK IMHO. Consequently, I agree > with the current behavior calling method_missing here. Well, I agree with the NoMethodError, but I wouldn't conclude that method_missing should be called. If an object decides to raise a NoMethodError and not call method_missing, that's its own choice. That has nothing to do with others, it's the decision of that object itself. Peter