I want AND
or OR
all the elements of the array, but with some control, as shown by selecting hash elements. Here is the behavior I want to achieve:
a = [{:a => true}, {:a => false}] a.and_map{ |hash_element| hash_element[:a] }
Is there a smooth, clean way to do this in Ruby?
source share