From: Wayne Vucenic Date: 2006-12-24T09:57:30+09:00 Subject: Re: why private is not private Hi Li, To add to what others have replied, "private" in Ruby means that the method cannot be called with an explicit receiver. So it can be called from a subclass (which wouldn't work for private methods in C++/Java), but it can't be called with an explicit "self." (which would work in C++/Java): class Object private def method1(arg1) arg1 end end class Test def test puts "calling method1 within Test..." puts method1(1) end end t = Test.new t.test puts "calling self.method1..." puts self.method1(2) --- calling method1 within Test... 1 calling self.method1... F:/Temp/privateTest.rb:21: private method `method1' called for main:Object (NoMethodError) C:\>ruby -v ruby 1.8.2 (2004-12-25) [i386-mswin32] Hope this helps, Wayne --- Wayne Vucenic No Bugs Software Ruby, C#, and Erlang Agile Contract Programming in Silicon Valley