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
By the way, from the referenced question
a ||= bis equivalent to
if a == nil a = b end
That's subtly incorrect, and is a source of bugs in newcomers' Ruby applications.
Since both (and only) nil and false evaluate to a boolean false, a ||= b is actually (almost*) equivalent to:
if a == nil || a == false
a = b
end
Or, to rewrite it with another Ruby idiom:
a = b unless a
(*Since every statement has a value, these are not technically equivalent to a ||= b. But if you're not relying on the value of the statement, you won't see a difference.)