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