Skip to content

Instantly share code, notes, and snippets.

@zaagan
Created January 27, 2020 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zaagan/befe5adb0adad797c0e97f7b6aab54b3 to your computer and use it in GitHub Desktop.
Save zaagan/befe5adb0adad797c0e97f7b6aab54b3 to your computer and use it in GitHub Desktop.
Ruby Basics - If Else
response = :greeting
# If Statement
if response == :greeting
puts "Hello !"
end
# Good
if response == :greeting then puts "Hello !" end
# Better
puts "Hello !" if response == :greeting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment