title: Make accessors private in child class
body: <p>Let's say I have a class A with public accessors:</p>
  
  <pre><code>class Test_A
      attr_accessor :a
      attr_accessor :b
      attr_accessor :c
  end
  </code></pre>
  
  <p>Its instance variables would be accessible, e.g:</p>
  
  <pre><code>test = Test_A.new()
  test.a = 3
  </code></pre>
  
  <p>I want to inherit the class Test_A in Test_B:</p>
  
  <pre><code>class Test_B &lt; Test_A
      private
          attr_accessor :d
          attr_accessor :e
  end
  </code></pre>
  
  <p>The instance variables inherited from Test_A are now also accessible in Test_B:</p>
  
  <pre><code>test = Test_B.new()
  test.a = 3
  </code></pre>
  
  <p>I want to achieve the following: </p>
  
  <ul>
  <li>If I create an instance of Test_A, all instance variables shall be accessible from outside.</li>
  <li>If I create an instance of Test_B, I want all inherited instance variables and methods from Test_A to be private.</li>
  </ul>
  
  <p>Is there any way to mark the methods and instance variables as private in the child class?</p>
  
  <p>Just some background: I am developing a rake based buildsystem: There are many "recipe" files which will define software sources like:</p>
  
  <pre><code>sw_pkg.srcs = "blabla.c blabla2.c"
  sw_pkg.incs = "blabla.h blabla2.h"
  </code></pre>
  
  <p>"sw_pkg" could be an instance of class A. All accessors must be accessible from outside, within these recipes.</p>
  
  <p>Within the Rakefile I scan all these recipes and use class B which defines all methods for building the sources defined in the recipe file. However, within the Rakefile I don't want to modify anything of the accessors derived from class A from the "outside"</p>