title: How to share methods between ruby modules
body: <p>Here is what I tried:</p>
  
  <pre><code>module A
    def self.method1; "method1"; end
    def method2; "method2"; end
  end
  
  module B; include A; end
  
  B.method1  # =&gt; error
  B.method2  # =&gt; error
  B::method1 # =&gt; error
  B::method2 # =&gt; error
  </code></pre>
  
  <p>I want to avoid copying and pasting equivalent code between two modules. The reason I'm using modules instead of classes here is because I don't need more than one instance of each module, as they simply hold constants (other modules, at this point).</p>
  
  <p>What is the best way to solve this problem?</p>