title: Ruby - getting value of hash
body: <p>I have a hash like </p>
  
  <p><code>{:key1 =&gt; "value1", :key2 =&gt; "value2"}</code> </p>
  
  <p>And I have a variable <code>k</code> which will have the value as <code>'key1'</code> or <code>'key2'</code>.</p>
  
  <p>I want to get the value of <code>k</code> into a variable <code>v</code>.</p>
  
  <p>Is there any way to achieve this with out using <code>if</code> or <code>case</code>? A single line solution is preferred. Please help.</p>