title: Executing code for every method call in a Ruby module
body: <p>I'm writing a module in Ruby 1.9.2 that defines several methods. When any of these methods is called, I want each of them to execute a certain statement first.</p>
  
  <pre><code>module MyModule
    def go_forth
      a re-used statement
      # code particular to this method follows ...
    end
  
    def and_multiply
      a re-used statement
      # then something completely different ...
    end
  end
  </code></pre>
  
  <p>But I want to avoid putting that <code>a re-used statement</code> code explicitly in every single method. Is there a way to do so?</p>
  
  <p>(If it matters, <code>a re-used statement</code> will have each method, when called, print its own name. It will do so via some variant of <code>puts __method__</code>.)</p>