Is there a method that let me compare one String with multiple others in Ruby? I really would like to do something like this:
myString.eql?([\"string1\",\"st
I find myself wanting this a lot, so I added a String method to be able to do it more idiomatically:
class String def among?(*array) array.flatten.include?(self) end end
Then
myString.among?("string1","string2","string3")