Use if and else to choose work based on a condition.

Conditionals

conditionals.rb
temperature = 

if temperature >= 80
  status = "warm"
else
  status = "comfortable"
end

puts "temperature=#{temperature}"
puts "status=#{status}"
temperature = 

if temperature >= 80
  status = "warm"
else
  status = "comfortable"
end

puts "temperature=#{temperature}"
puts "status=#{status}"
temperature = 

if temperature >= 80
  status = "warm"
else
  status = "comfortable"
end

puts "temperature=#{temperature}"
puts "status=#{status}"
conditional An `if` expression runs one branch when its condition is true and another branch when it is false.