Is there a way to iterate over a hash while adding to it? I keep getting a runtime error from:
hash.each do |key, val|
exit_meth if key == target_val
array(sub_arr).each do |sub_arr| hash[sub_arr] = key end
I tried iterating over the hash.keys instead but that stops after iterating the initial values of hash.