Skip to content

Instantly share code, notes, and snippets.

@danielmorrison
Created July 2, 2012 19:51
Show Gist options
  • Save danielmorrison/3035296 to your computer and use it in GitHub Desktop.
Save danielmorrison/3035296 to your computer and use it in GitHub Desktop.
if vs case
if status_code == 0
# do stuff
elsif status_code == 1
# do stuff
elsif status_code == 2
# do stuff
end
case status_code
when 0
# do stuff
when 1
# do stuff
when 2
# do stuff
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment