From: 7stud -- Date: 2011-03-31T11:20:24+09:00 Subject: Re: basic ENCAPSULATION help One of the key aspects of a private method is: a private method cannot be called with an explicit "receiver". What does that mean? The receiver is the object calling the method. In the following example: class Dog def bark puts "woof" end end spot = Dog.new spot.bark --output:-- woof ...spot is the "receiver" and spot calls the method bark(). However, according to the rules of ruby, you cannot specify a receiver when you call a private method. Well, than how does ruby know which object is calling the method? Now you enter the tricky realm of what's known as 'self'. When a method is not called with a receiver, ruby implicitly uses whatever object is self at the instant the method is called. RULE #1: When ruby executes code inside a method, then inside the method self is equal to the object that called the method. So, for instance, in the example above, when spot calls bark(), inside bark(), self is equal to spot. What that implies is that you will usually call private methods from inside public methods. -- Posted via http://www.ruby-forum.com/.