title: Accessing a Ruby hash with a variable as the key
body: <p>If I had the following ruby hash:</p>
  
  <pre><code>environments = {
     'testing' =&gt;  '11.22.33.44',
     'production' =&gt; '55.66.77.88'
  }
  </code></pre>
  
  <p>How would I access parts of the above hash? An example below as to what I am trying to achieve.</p>
  
  <pre><code>current_environment = 'testing'
  "rsync -ar root@#{environments[#{testing}]}:/htdocs/"
  </code></pre>