Created
March 12, 2015 21:40
-
-
Save franckverrot/c092173b293765ce0c08 to your computer and use it in GitHub Desktop.
||= and &&= don't complain the same way
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):001:0> $-w = true | |
=> true | |
irb(main):002:0> @foo ||= true | |
=> true | |
irb(main):003:0> @bar &&= true | |
(irb):3: warning: instance variable @bar not initialized | |
=> nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment