Last active
August 15, 2020 10:38
-
-
Save dcampogiani/c69ce11196c83f68c88fba88084d8429 to your computer and use it in GitHub Desktop.
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
object Extractor { | |
fun extractData(input: String): CardDetails { | |
val lines = input.split("\n") | |
val owner = extractOwner(lines) | |
val number = extractNumber(lines) | |
val (month, year) = extractExpiration(lines) | |
return CardDetails( | |
owner = owner, | |
number = number, | |
expirationMonth = month, | |
expirationYear = year | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment