Working with Logical And and multiple return values Ruby : I'm trying to check multiple conditions in a function.
So i have written following code

    def validate
      value,message = check_length(name) && is_valid(id)
    end

check_length and is_valid returns 2 values. so i store these values in value and message.

Now if check_length returns value as false, it shouldn't evaluate second method is_valid. Ideally with logical and, if first condition fails, it doesn't execute other method. But for above code even if check_length returns value as false, it evaluates is_valid and value is overridden by return value of is_valid.

How can we break if first condition value is false and return from validate function?
