title: Ruby: initialize() vs class body?
body: <p>In Ruby, what is the difference between putting code in an <code>initialize()</code> method rather than directly in the class body? Both appear to be executed when calling <code>MyClass.new</code>.</p>
  
  <p>Clearly, <code>initialize()</code> can accept parameters, but is that the only difference?</p>
  
  <pre><code>class MyClass
    puts 'Hello'
  
    def initialize(params)
      puts 'World'
    end
  end
  </code></pre>