In Ruby, how would I return true if a string is not in an array of options?
# pseudo code do_this if current_subdomain not_in [\"www\", \"blog\", \"foo\", \"
do this if not ["www", "blog", "foo", "bar"].include?(current_subdomain)
or you can use grep
grep
>> d=["www", "blog", "foo", "bar"] >> d.grep(/^foo$/) => ["foo"] >> d.grep(/abc/) => []