I\'ve got a list of values that are in a Ruby hash. Is there a way to check the value of the key and if it equals \"X\", then do \"Y\"?
I can test to see if the hash ha
I didn't understand your problem clearly but I think this is what you're looking for(Based on my understanding)
person = {"name"=>"BillGates", "company_name"=>"Microsoft", "position"=>"Chairman"}
person.delete_if {|key, value| key == "name"} #doing something if the key == "something"
Output: {"company_name"=>"Microsoft", "position"=>"Chairman"}