I have:
def user_validation
first_user_valid? || second_user_valid?
end
and I don't only want to return true/false but also want to return which method returns the true (maybe both?). I do have:
def user_validation
return true if first_user_valid?
return true if second_user_valid?
end
so far. But this does not seem very intuitive to me.
Thanks
You can return an array of responses:
def user_validation
[first_user_valid?, second_user_valid?]
end
This way you can know that the first returned true
, and the other false
...
# => [true, false]
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments