Jason Tao wrote in post #1131307:
> tool_name = code_book[cmd.to_sym]
>
> The downside I see here is it returns nil instead of "" if there is no
> matching.

There's this option:

tool_name = code_book[cmd.to_sym] || ''

-- 
Posted via http://www.ruby-forum.com/.