Skip to content

Instantly share code, notes, and snippets.

@priort
Created December 30, 2018 11:02
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 priort/de8267c4e2461542e9b0ce4e8dba891f to your computer and use it in GitHub Desktop.
Save priort/de8267c4e2461542e9b0ce4e8dba891f to your computer and use it in GitHub Desktop.
object Domain {
case class Drummer private (name:String) {
def copy() = Drummer(name)
}
object Drummer {
def apply(name:String) =
List("Max Roache", "Tony Williams", "Elvin Jones").find(_ == name).map(new Drummer(_))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment