title: Ruby modules for functions
body: <p>It is possible to add methods to a class using modules. E.g.,</p>
  
  <pre><code>class Test
    include Singleton
  end
  </code></pre>
  
  <p>Is it possible to do the same with methods? E.g.,</p>
  
  <pre><code>class Test
    include Singleton
  
    def test
      include Instructions_to_add_to_the_method
      puts 'done'
    end
  end
  </code></pre>
  
  <p>where:</p>
  
  <pre><code>module Instructions_to_add_to_the_method
    puts 'hi !'
  end
  </code></pre>
  
  <p>When calling <code>Test.instance.test</code>, I want:</p>
  
  <pre><code>hi !
  done
  </code></pre>
  
  <p>I do not wish to call another method, as it would give me issues with the scope of my variables.</p>