title: Rails - How can I check if a variable exists and also if it has a certain value in one statement
body: <p>Currently if it doesn't exists I get a the <code>undefined local variable or method</code> error.</p>
  
  <p>How can I check the value of the variable and also account for it not existing at all.</p>
  
  <p>I thought <code>&amp;&amp;</code> was the deal but:</p>
  
  <pre><code>if defined? aaa &amp;&amp; aaa == '123' then puts aaa end
  
  NameError: undefined local variable or method `aaa' for main:Object
  </code></pre>