 <p>Let's see if simplifying the code a bit can give a clearer picture:</p> <pre><code>if answer == "yes" return true elsif answer == "no" return false end puts "something" </code></pre> <p>is the most relevant part here. With the explicit <code>return</code>, the code exits from the method and never reaches the <code>puts</code>. The return value is therefore <code>true</code> or <code>false</code>.</p> <p>Without the explicit <code>return</code>:</p> <pre><code>if answer == "yes" true elsif answer == "no" false end puts "something" </code></pre> <p>The <code>true</code> and <code>false</code> statements merely exit the <code>if-else</code> code and executes the <code>puts</code>, the return value of which is <code>nil</code>.</p>