6 ms·
What's missing in the other comments is that you can't call private methods with an explicit receiver, for example my_object.private_meth or even self.private_m
by eaurouge 15y ago
What's missing in the other comments is that you can't call private methods with an explicit receiver, for example my_object.private_meth or even self.private_meth. On the other hand, public and protected methods can be called on self.
See this blog post for more info:
http://www.skorks.com/2010/04/ruby-access-control-are-private-and-protected-methods-only-a-guideline/ http://www.skorks.com/2010/04/ruby-access-control-are-privat...