Skip to content

Instantly share code, notes, and snippets.

@iulianu
Forked from iulianp360/gist:c129f3d2a3e7e2a6227a
Last active August 29, 2015 14:05
Show Gist options
  • Save iulianu/1f08f90eb4e3984ad83a to your computer and use it in GitHub Desktop.
Save iulianu/1f08f90eb4e3984ad83a to your computer and use it in GitHub Desktop.
sealed trait ContextDescription {
def value: String
}
final case class EmailContext(value: String) extends ContextDescription
final case class MobileContext(value: String) extends ContextDescription
// ...
Seq(EmailContext(email), MobileContext(mobile)).
filter(_.value.nonEmpty).
map( context =>
LocalPersonContext(
transaction.upload.identityId,
context,
line,
existingOrCurrentTimestamp(signupDate)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment