Skip to content

Instantly share code, notes, and snippets.

@dcampogiani
Last active August 15, 2020 10:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcampogiani/c69ce11196c83f68c88fba88084d8429 to your computer and use it in GitHub Desktop.
Save dcampogiani/c69ce11196c83f68c88fba88084d8429 to your computer and use it in GitHub Desktop.
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