a = 'crazy' a ||= 'attentive' puts 'my current mood is ' + a
=> my current mood is crazy
a ||= 'attentive' puts 'my current mood is ' + a
=> my current mood is attentive
References:
- Ruby Programming/Syntax/Operators [wikibooks.org]
- DABlog A short-circuit (||=) edge case [rubypal.com]