Our daily life contains a set of conditionals whose job is to define us as individuals, these conditionals are introduced to us from the very first day: Basic expression if user.status == puts if "online" "hello world" end Ruby syntax provides the necessary elements to translate any conditional programming sequence into manageable and easy to read lines of code. IF / ELSIF / ELSE STATEMENT The expression acts as a question and the outcome is determined by the answer to that question, with the help of the and statements, the possibilities are endless: if elsif else user.mood == puts user.mood == puts puts if "happy" "time to study" elsif "sad" "time to play" else "time to code" end The statement evaluates anything we put in front of him, if the result returns the condition is accepted and the piece of code inside gets executed, if the result returns or (null) then we continue with the next condition, in this case (else if) and the same process applies, if the result of is then it should output the message , and finally if no condition is , the statement is executed. if true false nil elsif elsif true "time to play" true else IF AS A MODIFIER As with the example above, the difference here is that first we need to write the "answer" or the code to be executed, then we pass the statement followed by the "question" or condition, which it's executed if the result is : if true puts > "it's true!" if 1 0 # returns "it's true" alarm.sound = off current_day = current_day = if 'saturday' || 'sunday' UNLESS STATEMENT Unlike the statement who checks for a value, the statement does the opposite and checks for or : if true unless false nil cellphone.battery.percentage > cellphone.start_charge unless 14 end We can combine the expression only with the statement: unless else job.isDone? puts puts job.isDone = unless "go back to work" else "good job!" end true # returns "good job!" UNLESS AS A MODIFIER Just as his relative , can be used as a modifier serving the same purpose but only executing itself when the result is or if unless false nil: Examples: puts > "it's not right!" unless 4 3 # 4 > 3 is true so code doesn't execute alarm.sound = on current_time < unless "7:00am" CASE / WHEN / ELSE STATEMENT The statement is another Ruby conditional that can be used as an alternative to , it's most frequently used to structure and create efficient code when there is a wide number of possible outcomes: case if / unless fuel_level ... puts ... puts ... puts puts case when 71 100 "Fuel Level: High" when 41 70 "Fuel Level: Medium" when 21 40 "Fuel Level: Low" else "Fuel Level: Very Low" end fuel_level: 12 # returns "Fuel Level: Very Low" is the expression to be evaluated, the expression contains each one of the conditions, if a condition returns , the code inside is executed and concludes with the statement, finally the expression acts as the default condition to be executed if none of the case conditions return . case when true end else true Links Ruby Official Website https://www.ruby-lang.org/en/ Ruby Documentation https://www.ruby-lang.org/en/documentation/ Ruby Control Expressions https://docs.ruby-lang.org/en/2.7.0/syntax/control_expressions_rdoc.html If you made it this far i hope this article helped you in one way or another, thanks for reading!