Private methods cannot have a receiver
I think the answer is this: the Ruby method of ensuring the confidentiality of the method is that it does not allow calling private methods with an explicit recipient.
Example:
class Baker def bake_cake make_batter self.use_oven # will explode: called with explicit receiver 'self' end private def make_batter puts "making batter!" end def use_oven puts "using oven!" end end b = Baker.new b.bake_cake
Since there cannot be an explicit receiver, you certainly cannot make b.use_oven
. This is how confidentiality is ensured.
source share