Yeah && and || have what is called a “short circuit” behavior where they will only evaluate the right hand side of the operand if they need to. This allows you to do things like:
value = params[:some_opt_key] || raise "this parameter is required!
If the left hand side is “truthy” then || short circuits and doesn’t evaluate the raise at all. This sort of branching behavior doesn’t even make sense in guards.






















