Skip to content

Instantly share code, notes, and snippets.

@matstc
Created October 21, 2014 13:36
Show Gist options
  • Save matstc/8d693575d17f2e1e3f6c to your computer and use it in GitHub Desktop.
Save matstc/8d693575d17f2e1e3f6c to your computer and use it in GitHub Desktop.
Example of skinny if branch
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