Last active
August 29, 2015 14:19
-
-
Save raganwald/ed8cd3eebcac921ac047 to your computer and use it in GitHub Desktop.
The way I usually format if-as-expressions
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
something = if condition | |
value-if-truthy | |
else | |
value-if-falsy |
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
return condition | |
? value-if-truthy | |
: value-if-falsy; |
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
involeMethodWith if condition | |
value-if-truthy | |
else | |
value-if-falsy | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment