title: Cloning a Hash in Ruby2
body: <p>Im trying to clone a hash, to make a new copy of the original hash but it seems that when I set a value in the new hash, I have the same effect on the original hash. </p>
  
  <pre><code>rr = Hash.new
  command = "/usr/local/bin/aws route53 list-resource-record-sets --hosted-zone-id EXAMPLEID --max-items 1"
  
  rr=JSON.parse(%x{#{command}})
  
  puts rr
  
  if rr["ResourceRecordSets"][0]["TTL"] != 60
    new_rr = rr.clone
    new_rr["ResourceRecordSets"][0]["TTL"] = 60
    puts rr
    puts new_rr
  end
  </code></pre>
  
  <p>Output: </p>
  
  <pre><code>{"NextRecordType"=&gt;"MX", "NextRecordName"=&gt;"example.com.", "ResourceRecordSets"=&gt;[{"ResourceRecords"=&gt;[{"Value"=&gt;"1.2.3.4"}], "Type"=&gt;"A", "Name"=&gt;"example.com.", "TTL"=&gt;1800}], "MaxItems"=&gt;"1", "IsTruncated"=&gt;true}
  {"NextRecordType"=&gt;"MX", "NextRecordName"=&gt;"example.com.", "ResourceRecordSets"=&gt;[{"ResourceRecords"=&gt;[{"Value"=&gt;"1.2.3.4"}], "Type"=&gt;"A", "Name"=&gt;"example.com.", "TTL"=&gt;60}], "MaxItems"=&gt;"1", "IsTruncated"=&gt;true}
  {"NextRecordType"=&gt;"MX", "NextRecordName"=&gt;"example.com.", "ResourceRecordSets"=&gt;[{"ResourceRecords"=&gt;[{"Value"=&gt;"1.2.3.4"}], "Type"=&gt;"A", "Name"=&gt;"example.com.", "TTL"=&gt;60}], "MaxItems"=&gt;"1", "IsTruncated"=&gt;true}
  </code></pre>
  
  <p>I dont see Hash.clone documented in Ruby 2.0, should I be using another method to create a Hash copy now? </p>
  
  <p>Thanks in advance.</p>