title: How can I replace a single Hash Value in Ruby by using its number
body: <p>A fairly simple question, but I don't see it anywhere on SO, and I'm a Ruby noob.</p>
  
  <p>In Ruby, if I have a hash, similar to this.</p>
  
  <pre><code>hashOne = {'dog' =&gt; 'canine', 'cat' =&gt; 'feline', 'me' =&gt; 'rubynooby'}
  </code></pre>
  
  <p>And let's assume that I want to replace the value a couple of different ways.</p>
  
  <p><strong>Method 1</strong></p>
  
  <p>Let's say I want to replace the value of <code>me</code> with <code>rubypro</code>.  I've seen this done this way:</p>
  
  <pre><code>hashOne[:me] = "rubypro"
  </code></pre>
  
  <p>but I haven't seen a solution to replacing the value by which number it is, for example, let's assume that I always want to change the 3rd key (and assuming it starts on 1 and not 0)</p>
  
  <p><strong>Method 2</strong> - These don't work</p>
  
  <pre><code>hashOne[3] = "rubypro"
  </code></pre>
  
  <p>or</p>
  
  <pre><code>hashOne.values[3] = "rubypro"
  </code></pre>
  
  <p>I haven't seen any examples of this, or a question about it on SO.  Can someone point me in that direction?</p>
  
  <p>The reason I was trying to work on this, is because I have a Hash, where I don't know what the key is, but I know what I want the value to be.  It's weird, but that's where I'm at.</p>