Mega Code Archive

 
Categories / Ruby / Statement
 

Unless statement simply operates in the logically reverse sense from the if statement

temperature = 76      unless temperature < 65 || temperature > 85   puts "Picnic time!" else   puts "Sorry, no picnic today." end