How can I do something like this ? or do i need to use IF all the time?
ar = [["a","b"],["c"],["d","e"]]
x = "b"
case x
when ar[0].include?(x)
puts "do something"
when ar[1].include?(x)
puts "do else"
when ar[2].include?(x)
puts "do a 3rd thing"
end
I'm using ruby 1.8.7