I have a hash, whose values are true or false. What is the most Ruby-esque way to see if all the values of a given sub-hash of this hash are the same?
h[:a] = true
h[:b] = true
h[:c] = true
h[:d] = false
[h[:a], h[:b], h[:c]].include? false
[h[:a], h[:b], h[:c]].include? true
Is there a better way to write this?
values_atis the method to get a collection of values out of a Hash: