title: Ruby : Conditional initialization
body: <p>I've read about conditional initialization in Ruby and </p>
  
  <pre><code>obj1 ||= Class1.new   
  </code></pre>
  
  <p>is same as   </p>
  
  <pre><code>obj1 ||obj1 = Class1.new
  </code></pre>
  
  <p>as everything is Ruby is an Object, I wonder why the following phrase raises a "NameError: undefined method or name...":</p>
  
  <pre><code>x || x = 10
  </code></pre>
  
  <p>but </p>
  
  <pre><code>x ||= 10
  </code></pre>
  
  <p>is a correct statement</p>