Just add !! (a.k.a. the double bang operator) before any statement:
>> @document = Document.new
=> <Document id: nil, title: nil>
>> @document.title
=> nil
>> !!@document.title
=> false
>> @document.title = "My new document"
>> !!@document.title
=> true
In Rails, you can use the name of your attribute followed by a question mark:
>> @document.title?
=> true
>> @document.title = nil
>> @document.title?
=> false
If you want to read more about this, I recommend the following blogposts and their comments:
This tip was submitted by Vladimir Rybas.
You can use HTML tags for formatting. Wrap code in <code> tags and multiple lines of code in <pre><code> tags.