Created
October 8, 2012 17:20
-
-
Save alindeman/3853712 to your computer and use it in GitHub Desktop.
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
1.9.3p194 :001 > 1==1?"one":"not one" | |
=> "one" | |
1.9.3p194 :002 > def one | |
1.9.3p194 :003?> 1 | |
1.9.3p194 :004?> end | |
=> nil | |
1.9.3p194 :005 > 1==one?"one":"not one" | |
SyntaxError: (irb):5: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '(' | |
1==one?"one":"not one" | |
1.9.3p194 :006 > 1==one ? "one":"not one" | |
=> "one" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'd rewrite it as a
(blah if foo) || bar
to show it in a terser form. In which case yes, it would look to be because1?
isn't a method name, butone?
could be.