I am confused about how the Ruby unless conditional works with the || operator.
So what I've got essentially:
<% unless @instance_variable.method || local_variable.another_method %>
code block
<% end %
At the moment, the first part is evaluating to false and the second part to true. And I do not get an error raised, it does what I want. However, if I just write:
<% unless @instance_variable.method %>
code block
<% end %>
I get an error thrown and I get an error when I write:
<% unless @instance_variable.method && local_variable.another_method %>
code block
<% end %>
So my question. If the first part is evaluating to false, will it cut short and go through the code block, and not looking at the other side? If so, why does leaving the second part out throw an error? And hows does it all work?
Apologies if you need the code, I feel like this is a logic/algebra solution.