title: Use attribute of a derived class in parent
body: <p>I'm trying to use <code>define_method</code> to create additional methods for classes inheriting from a superclass:</p>
  
  <pre><code>class Child &lt; Parent
    ADDITIONAL_METHODS += ['xyz', 'qwe']
  end
  
  class Parent
    ADDITIONAL_METHODS = ['common']
    ADDITIONAL_METHODS.each do |key|
      define_method key do
        ...
      end
    end
  end
  </code></pre>
  
  <p>This doesn't work because ADDITIONAL_METHODS is always taken from the Parent class and the only method created is <code>common</code>. Is there a way to access the attribute from the derived class? </p>