From: Ben Bleything Date: 2007-08-02T07:07:22+09:00 Subject: Re: Private methods not so private? On Thu, Aug 02, 2007, Frank Meyer wrote: > class Test > private > def print_hello > puts "Hello everyone!" > end > end > > t = Test.new > t.send( "print_hello" ) > > This program runs just fine and prints "Hello everyone!". > > Is this behaviour to be expected? Yes. send bypasses protection levels, for reasons I'm not really clear on. If I were to hazard a guess, it would be that what you send is eval'ed inside the context of the object, thereby making self the receiver, but that's a total guess. Test.new.print_hello will cause the error you expect. As a sidenote, upgrade your ruby ;) Ben