From: Steve Klabnik Date: 2012-03-07T04:23:10+09:00 Subject: Re: Getting the class of an object. methods that end in ? may not return a boolean, but they will return something that's 'truthy' or 'falsy': $ irb 1.9.3p125 :001 > defined?(foo) => nil 1.9.3p125 :002 > if defined?(foo) 1.9.3p125 :003?> puts "Defined!" 1.9.3p125 :004?> end => nil 1.9.3p125 :005 > foo = "hello" => "hello" 1.9.3p125 :006 > defined?(foo) => "local-variable" 1.9.3p125 :007 > if defined?(foo) 1.9.3p125 :008?> puts "Defined!" 1.9.3p125 :009?> end Defined! => nil