3. What the difference between IF and UNLESS?


Could you please explain where the difference between if and unless?
If I understand correctly we use "if" when an even already have place now and "unless" before an event happend. Is it correct?


unless is just a negated if. That is, it executes whatever it contains if the condition is not true.

unless foo?
    # blabla

Simply means

if !foo?
    # blabla



Simply, the difference is "If not = unless".