Skip to content

Instantly share code, notes, and snippets.

@siakaramalegos
Created October 20, 2015 15:53
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 siakaramalegos/adcc668e1cfc5fee8d3d to your computer and use it in GitHub Desktop.
Save siakaramalegos/adcc668e1cfc5fee8d3d to your computer and use it in GitHub Desktop.
Activity app showing branches and methods
todays_temp = 80
weather_condition = "sunny"
def activity(temp, condition="sunny")
if temp == 80 && condition == "sunny"
puts "That's the perfect temp! Let's still go hiking."
elsif temp > 50 && condition == "sunny"
puts "I'm going hiking!"
else
puts "Let's read a book."
end # ends if
end # ends method
activity(todays_temp)
activity(70)
activity(40)
activity(70, "rainy")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment