From: Adam Prescott Date: 2013-02-10T12:20:29+09:00 Subject: Re: elegant way to determine if something is defined > Object.defined?('a') defined?(a) #=> nil b = a + 1 #=> NameError a = 1 defined?(a) #=> "local-variable" (strings are truthy) However, relying on defined?(a) to check for local variables is probably a code smell: they're local variables, why isn't the code just written properly? What's the problem you're trying to solve?