I want a method to return true when all the elements of an array are equal and are "yes". I have one array ["yes", "yes", "yes"]. All its elements are the same "yes". I want it to return true. For ["no", "no", "no"], although all the elements are "no", the value is not equal to "yes". How can I do that?
I am using this method to check this:
def self.all_equal?(array) array.max == array.min end but it returns true for ["no", "no", "no"].