title: Best way to remove element from Ruby hash array in yaml
body: <p>I see a lot online about removing <em>keys</em> from yaml, but not much on removing a element from a hash array (maybe I'm searching on the wrong concept?). Sorry, I'm pretty new to Ruby or any programming for that matter.</p>
  
  <p>I'm trying to remove a specific port from the yaml file without actually deleting the IP itself or any of the rest of its array value.</p>
  
  <pre><code>require 'yaml'
  ip = 1.2.3.4
  port = 3333
  
  hash = YAML.load_file('ips.yml')
  hash.delete([ip][port])
  File.open('ips.yml','w'){|f| YAML.dump(hash,f)}
  </code></pre>
  
  <p>yaml file</p>
  
  <pre><code>---
  69.39.239.151:
  - 7777
  - 8677
  - 8777
  69.39.239.75:
  - 9677
  - 9377
  209.15.212.147:
  - 8477
  - 7777
  104.156.244.109:
  - 9999
  1.2.3.4:
  - 3333
  - 4444
  </code></pre>