How would I go about removing all empty elements (empty list items) from a nested Hash or YAML file?
Thanks for any advice.
How would I go about removing all empty elements (empty list items) from a nested Hash or YAML file?
Thanks for any advice.
Use hsh.delete_if. In your specific case, something like: hsh.delete_if { |k, v| v.empty? }