title: How to automatically include module in nested submodules
body: <p>I have a module <code>Top</code>, which has modules <code>A</code> and <code>B</code>. In each of them, I want to use class methods of module <code>C</code>. To do that, I have to include <code>C</code> for each module <code>A</code> and <code>B</code>. Is it possible to include <code>C</code> in <code>Top</code> so that its class methods are accessible to all the submodules?</p>
  
  <p>Example:</p>
  
  <pre><code># I'll extend module C in example to make it shorter
  
  module C
    def foo; puts 'Foo!' end
  end
  
  module Top
    extend C
  
    module A  end
    module B  end
  end
  
  # That's how it works now
  
  Top.foo
  #=&gt; "Foo!"
  Top::A.foo
  #=&gt; NoMethodError: undefined method `foo' for Top::A:Module
  Top::B.foo
  #=&gt; NoMethodError: undefined method `foo' for Top::B:Module
  
  # That's how I want it to work
  
  Top.foo
  #=&gt; "Foo!"
  Top::A.foo
  #=&gt; "Foo!"
  Top::B.foo
  #=&gt; "Foo!"
  </code></pre>