From: "Wolfgang Nádasi-Donner" Date: 2007-01-28T05:40:09+09:00 Subject: Re: instance variables available in derived clases Avdi Grimm schrieb: > To the contrary, it's not madness at all. It's a legitimate > interpretation of OO principles to say that a private member variable > is private to a class, and should be inaccessible to all clients of > the class - INCLUDING derived classes. I think this not possible in Ruby in general, because onybody can change a class later. It's normal practice to write code in Ruby, which changes classes of the standard library. >>>>> Example >>>>> class Otto def show puts "here is 'show'" end private def hiddenshow puts "here is 'hiddenshow'" end end o = Otto.new o.show o.hiddenshow rescue puts '+++ cannot call hiddenshow' class Otto public :hiddenshow end o.hiddenshow >>>>> Output >>>>> here is 'show' +++ cannot call hiddenshow here is 'hiddenshow' >>>>> EoE >>>>> Wolfgang N�dasi-Donner