title: Access Hash with multiple values ruby
body: <p>I have a hash</p>
  
  <pre><code>h = Hash.new{|hsh,key| hsh[key] = [] }
  </code></pre>
  
  <p>And its values are stored as an array</p>
  
  <p>Iv added to the value array for the key like so:</p>
  
  <pre><code>h[@name] &lt;&lt; @age
  h[@name] &lt;&lt; @grade
  </code></pre>
  
  <p>and im trying to access the age like this </p>
  
  <pre><code>puts h[:@name][0]
  </code></pre>
  
  <p>But it doesn't work?</p>
  
  <p>Is there a better way of doing this?</p>
  
  <p>What im trying to do is create is a hash where there is a key which has loads of values:
  For example <code>key=&gt;name</code> and values equal <code>age</code>, <code>address</code>, <code>gender</code> etc</p>