One thing I love about ruby is that mostly it is a very readable language (which is great for self-documenting code)
However, inspired by this question: Ruby Code ex
a = (b && b.attribute) || "default"
is roughly:
if ( ! b.nil? && ! b == false) && ( ! b.attribute.nil? && ! b.attribute.false) a = b else a = "default"
I use this when b is a record which may or may not have been found, and I need to get one of its attributes.