Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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