News for hackers. Stuff that matters.
Re:Your Code is My Hell by route66 on Monday August 22, 2011 @01:16PM (#2913192)
Strictly speaking ruby, private only forbids calling the method in question with an explicit receiver.

object_instance.private_method is obviously prohibited, but so is self.private_method when called from another class method. The latter one is fine when private_method is called, without the self. To circumvent privateness in the other case ("calling an underscored method") you would have to say object_instance.send(:private_method).

Re:Your Code is My Hell by petercooper on Monday August 22, 2011 @03:56PM (#2913862)
Luckily there's also protected, which allows you to call with an explicit receiver, but only from an instance of the same class (or within its hierarchy).