From: Eric Jacoboni Date: 2001-05-04T23:11:23+09:00 Subject: [ruby-talk:14636] Yet another "About private methods" question I'm still trying to figure out the semantics of private methods in Ruby. If i create the following class: class Foo def speak puts "I'm foo" end private def nono puts "Private code" end end and the following code : myfoo = Foo.new myfoo.speak myfoo.nono i get the expected results: Foo.rb:14: private method `nono' called for # (NameError) If a create a subclass: class Bar < Foo def speak puts "I'm bar" end def nono super puts "Public code" end end and the following code : mybar = Bar.new mybar.speak mybar.nono I get: I'm bar Private code Public code So my use of 'private', above, don't have the semantic i used to consider, as anyone is able to call a private method simply by creating a subclass. Is there a mechanism allowing creation of "true" (from my point of vue) private methods, ie not exported, even in subclasses ? Feel free to send me a RTFM with a pointer. Perhaps my bad english is responsible of my misunderstanding... -- Eric Jacoboni -- IUP NTIE Universitde Toulouse II.