I'm trying to return the first element in the given array that matches an element in a preset array. I have this:
def find_the_cheese(a)
cheese_types = ["cheddar", "gouda", "camembert"]
a.collect{|c| cheese_types.include?(c)}.include?(true)
end
But it returns true rather than the c value from the enclosed brackets. How can I return the matching element?