From: Lyle Johnson Date: 2008-06-12T06:12:15+09:00 Subject: Re: ||= On Wed, Jun 11, 2008 at 3:59 PM, Justin To wrote: > what does ||= do? The expression: x ||= y is shorthand for: x = x || y where "||" is the OR-operator. If x evaluates as false or nil, the value of y will be assigned to x; otherwise, x keeps its original value. So, for example, x = nil x ||= 42 # now x has value 42 x ||= 23 # x stays at 42 Hope this helps, Lyle