From: Tsunami Script Date: 2009-01-28T08:31:24+09:00 Subject: how can I switch over an array ? I have the following code snippet : def call(char,value) case char when " ","#","!","@","$","%","^","&","*","(",")","{","}"," [","]","\'","\"","<",">",",",".","?",";","\n","\r" @map[char].call(value) when "digit" @map[char].call(value) when "char" @map[char].call(value) else puts "don't know what to do with #{char} and #{value}" end end can the first when be written in a simpler way ? -- Posted via http://www.ruby-forum.com/.