Created
October 21, 2014 13:36
-
-
Save matstc/8d693575d17f2e1e3f6c to your computer and use it in GitHub Desktop.
Example of skinny if branch
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
def comment_on_popularity | |
if post.stars.empty? | |
"Your post is flying under the radar." | |
else | |
if post.stars.count > 100 | |
"Congratulations. Your post is popular!" | |
elsif post.stars.count > 50 | |
"Well done. Your post is trending." | |
else | |
"Doing well but could use a little attention." | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment