You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The type is an element of a set. I know it's easy to write with as a lambda. But it's way better to read, when you have a notation like HashValidator::Union[*typesl]. Another name could be HashValidator::Or.
classEmail;attr_accessor:text;end# Validations hashvalidators={email: HashValidator::Union[String,Email]}# First case, it's a Stringuser1={email: 'james@github.com'}HashValidator.validate(user1,validations)# Second case, it's an Emailemail=Email.newemail.text='ellcs@github.com'user2={email: email}HashValidator.validate(user2,validations)
The text was updated successfully, but these errors were encountered:
Hello james! I have a feature request. Most modern languages have a concept named union types:
The type is an element of a set. I know it's easy to write with as a
lambda
. But it's way better to read, when you have a notation likeHashValidator::Union[*typesl]
. Another name could beHashValidator::Or
.The text was updated successfully, but these errors were encountered: