T
Tsunami Script
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 ?
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 ?