/revealing-way-2.kt Secret
Last active
August 26, 2019 10:11
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun validateEmailAddress(value: String): EmailAddress { | |
// does some validation and | |
// if the validation fails it returns InvalidEmailAddress | |
// otherwise a ValidEmailAddress | |
} | |
fun validatePassword(emailAddress: ValidEmailAddress, password: String): Password { | |
// does some validation against the valid email address | |
// if the validation fails it returns an InvalidPassword | |
// otherwise a ValidPassword | |
} | |
fun requestToken(emailAddress: ValidEmailAddress, password: ValidPassword): Token { | |
// having only valid values makes the code simple | |
// just make the request and return the token | |
return Token("some kind of token") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment