From: Ben Bleything Date: 2011-02-16T03:29:53+09:00 Subject: Re: Explain private methods? On Tue, Feb 15, 2011 at 10:22 AM, Gaba Luschi wrote: > When you use the word "private" to clear private methods - what does it > mean that only code within the object's methods can access those private > methods?  Can someone give me a simple example of this? That's basically correct, yes. Technically it means that the method cannot be called with an explicit receiver: class Foo def pub return "public method" end def call_priv priv end def call_priv_explicitly self.priv end private def priv return "private method" end end f = Foo.new f.pub # => "public method" f.priv # => private method `priv' called for # (NoMethodError) f.call_priv # => "private method" f.call_priv_explicitly # => private method `priv' called for # (NoMethodError)