Private methods in Ruby
Method visibility in Ruby is different from other languages, especially Java. In Java, public methods or data members are accessible from everywhere, protected ones can only be accessed by the containing class or subclasses and private members are visible only to the class where they are defined. In contrast to that, method visibility in Ruby is all about the receiver of the message as this blog post by Jamis Buck from 2007 explains very clearly with some example code.
Ruby allows public methods to be called with explicit receiver, self or implicit receiver. Protected methods may be called if the receiver is of the same class as “self” (explicit or implicit) and private methods cannot be called with an explicit receiver at all.
This is how private/protected/public are designed to work in Ruby and it is helpful to not think about method visibility in terms of inheritance - it avoids a lot of confusion because for example in Ruby, a subclass can call the private method of its parent.