title: Check if an element-hash exists in an array and update it, otherwise insert it
body: <p>I have a list of hashes:</p>
  
  <pre><code>[
    {'key1': 'value1', 'key2': some_object},
    {'key1': 'value21', 'key2': some_object2},
    {'key1': 'value133', 'key2': some_object3}
  ]
  </code></pre>
  
  <p>What's the easiest way to check if an element with <code>'key1': 'value133'</code> exists (if my case it does) and update it, (say <code>'key1': 'value133', 'key2': some_object333}</code> otherwise insert it (<code>{'key1': 'value133', 'key2': some_object3}</code>)?</p>