From: "Peña, Botp" Date: 2007-11-21T12:34:44+09:00 Subject: Re: is there an nicer way for this expression? From: Trans [mailto:transfire@gmail.com] # case foo.bar when 1,2 then hmm ;-) bar #=> 1 bar.in? 1,2 #=> 0 bar.in? 1,2,3 #=> 0 bar.in? 2,1,3 #=> 1 bar.in? *[2,1,3] #=> 1 bar.in? [2,1,3],1,2 #=> 1 [2,1,3].in? [2,1,3],1,2 #=> 0 [2].in? [2,1,3],1,2 #=> nil {1=>2}.in? [2,1,3],1,2,{1=>2},{2=>4} #=> 3 bar.in? *(1..2) #=> 0 bar.in? 3,4,*(1..2) #=> 2 bar.in? 3,4,*(2..5) #=> nil aliased w among, amongst, and one_of (just lately) kind regards -botp