title: Multiple return values with arrays and hashes
body: <p>I believe arrays are mostly used for returning multiple values from methods:</p>
  
  <pre><code>def some_method
    return [1, 2]
  end
  
  [a, b] = some_method # should yield a = 1 and b = 2
  </code></pre>
  
  <p>I presume this is a kind of syntactic sugar that Ruby provides. Can we get a similar result with hashes, for instance</p>
  
  <pre><code>def some_method
    return { "a" =&gt; 1, "b" =&gt; 2 }
  end
  
  {"c", "d"} = some_method() # "c" =&gt; 1, "d" =&gt; 2
  </code></pre>
  
  <p>I'm looking for the result <code>{ "c" =&gt; 1, "d" =&gt; 2 }</code>, which obviously does not happen. Is there any other way this can be done? I know that we can return a hash from the method and store it and use it like so</p>
  
  <pre><code>def some_method
    return {"a" =&gt; 1, "b" =&gt; 2}
  end
  
  hash = some_method()
  </code></pre>
  
  <p>Just curious if there is another way similar to the one with arrays but using hashes....</p>
  
  <hr>
  
  <p>I think a simpler way to put the question would be...</p>
  
  <pre><code>
  
      # If we have a hash
      hash = {"a" => 1, "b" => 2}
  
      # Is the following possible
      hash = {2, 3} # directly assigning values to the hash.
      OR
      # another example
      {"c", "d"} = {2, 3} # c and d would be treated as keys and {2, 3} as respective values.
  
  </code></pre>