title: Building a hash in a conditional way
body: <p>I am using Ruby on Rails 3.0.10 and I would like to build an hash key\value pairs in a conditional way. That is, I would like to add a key and its related value if a condition is matched:</p>
  
  <pre><code>hash = {
    :key1 =&gt; value1,
    :key2 =&gt; value2, # This key2\value2 pair should be added only 'if condition' is 'true'
    :key3 =&gt; value3,
    ...
  }
  </code></pre>
  
  <p>How can I do that and keep a <em>"good" readability</em> for the code? Am I "forced" to use the <code>merge</code> method?</p>