title: Running a method after the initialize method
body: <p>I would like to write some ruby code that runs after the initialize method is called. This code can be in a class or a module. How would I write this?</p>
  
  <p>Here is an example of what I want:</p>
  
  <pre><code>class Base
    def after_init
      puts "after init"
    end
  
  class A &lt; Base # Option 1, use a class
  end
  
  class B &lt; Base
    def initialize
      puts "in init"
    end
  end
  
  module MyMod
    def after_init
      puts "after init"
    end
  end
  
  class C
    include Module
  end
  
  $&gt; A.new
  =&gt; "after init"
  $&gt; B.new
  =&gt; "in init"
  =&gt; "after init"
  $&gt; C.new
  =&gt; "after init"
  </code></pre>
  
  <p>What I definitely don't want to do is make an explicit call to <code>super</code>. Is there a way to do this? I don't care if it uses a lot of Ruby's reflective abilities. Thanks!</p>