I you want to test out code. Best thing in ruby is to spin up an instance of irb.
The interactive ruby bash can be used to test those assumptions.
Next thing is the usage of a_boolean == true. This is not considered good style in ruby. Just write a_boolean or !a_boolean.
Another thing is that "loops" are a different thing that "conditions".
loops -> while, until, etc
conditions -> if, unless, etc
Short answer to your question. unless is the opposite of if, it is !if
ليست هناك تعليقات:
إرسال تعليق