Ruby - Conditionals unless - case
Greetings of the Day!!! We have gone over all the basics that you will need in order to work with Conditionals, if, else and else if will do everything that you need. However, there are a couple of convenience conditionals that we can also use that work kind of like a shorthand. We are going to look at four of them. There is unless, case, the ternary operator and or/or-equals. So let's start out by looking at unless. It looks like this, exactly like the if statement, but instead of if it's unless. So unless a Boolean is true, which means the same as if not true, it's the reverse. So instead of being if not x > 3, it's unless x > 3. So unless it's true, do this block of code. Now unless can sometimes tie you in logical knots trying to work through exactly when it's going to be used. So only use it if it makes a lot of sense. If it feels right and it's convenient to use unless, but don't let ...