From: Joel VanderWerf Date: 2010-10-12T05:51:54+09:00 Subject: Re: more idiomatic way to avoid errors when calling method on variable that may be nil? On 10/11/2010 01:19 PM, Josh Cheek wrote: > But people seem to really be opposed to doing this. Not entirely sure why. > Maybe because it wouldn't raise an error if, for example, you put some > absurd type of data in your hash? Absurd? It's an easy to get symbols where strings should be... key = "a" hash = {"a" => :Foo} var = hash[key].downcase rescue nil p var # ==> nil