vendredi 6 mars 2020

Ruby unless vs if logic [closed]

Can someone please explain why this is happening? It is regarding the case pattern >> when nil (in the pics).

When I set the default result of my_all to true with the conditional of result = false unless i >> nil evaluates to false and it works properly. unless case

However, if I set the default to false with conditional of result = true if i >> nil evaluates to true and it's not working properly. if case

Aucun commentaire:

Enregistrer un commentaire