title: Ruby - Undefined method 'has_key?' on ternary assignment
body: <p>I'm getting the following error on Ruby when I try to assign a string to a variable:</p>
  
  <pre><code>undefined method 'has_key?' for nil:NilClass (NoMethodError)
  </code></pre>
  
  <p>The code that generates the error is the following:</p>
  
  <pre><code>uri = !@meta.has_key?("offset") ? "#{@@user_uri}?order=asc" : "#{@@user_uri}?per_page=#{per_page}&amp;page=#{@meta['offset']}?order=asc"
  </code></pre>
  
  <p>If I remove the assignment and replace it with a puts, it works as expected</p>
  
  <pre><code>puts !@meta.has_key?("offset") ? "#{@@user_uri}?order=asc" : "#{@@user_uri}?per_page=#{per_page}&amp;page=#{@meta['offset']}?order=asc"
  &gt; http://example.com/users?order=asc
  </code></pre>
  
  <p>Any idea on what's going on?</p>