title: When can I omit curly braces for a Ruby hash?
body: <p>So this is legal in Ruby:</p>
  
  <pre><code>puts key: "value"
  </code></pre>
  
  <blockquote>
    <p>{:key=>"value"}</p>
  </blockquote>
  
  <p>But this is not:</p>
  
  <pre><code>hsh = key: "value"
  puts hsh
  </code></pre>
  
  <blockquote>
    <p>sandbox.rb:1: syntax error, unexpected ':', expecting end-of-input</p>
    
    <p>hsh = key: "value"</p>
  </blockquote>
  
  <p><strong>Why not?</strong> When am I allowed to omit curly braces for hashes?</p>