From: "Peña, Botp" Date: 2008-11-11T10:46:44+09:00 Subject: Re: Comparing variable to multiple values From: Greg Lazarev [mailto:russianbandit@gmail.com] # I'm wondering if there's a better way to do this in ruby: # if a == "word1" || a == "word2" or || a == "word3" # puts "good" # end ruby allows you to beautify ;) > def in? container > container.include? self > end => nil > puts "good" if a.in? %w(word1 word2 word3 whatever) good fwiw, sometimes in cases like this, i start off with a... case, > case a > when "word1", "word2","word3" > puts "good" > end then just sprinkle w more cases, and beautify as i go...