Skip to content

Instantly share code, notes, and snippets.

@franckverrot
Created March 12, 2015 22:12
Show Gist options
  • Save franckverrot/7f1cc6932c2c6b04c131 to your computer and use it in GitHub Desktop.
Save franckverrot/7f1cc6932c2c6b04c131 to your computer and use it in GitHub Desktop.
||= vs = .. ||
>> $-w=true
=> true
>> @a ||= @b
(irb):2: warning: instance variable @b not initialized
=> nil
>> @c = @c || @d
(irb):3: warning: instance variable @c not initialized
(irb):3: warning: instance variable @d not initialized
=> nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment