Skip to content

Instantly share code, notes, and snippets.

Created June 23, 2014 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/43c3e0710952ce1370a3 to your computer and use it in GitHub Desktop.
Save anonymous/43c3e0710952ce1370a3 to your computer and use it in GitHub Desktop.
case class Foo(a: String, b: Int)
object Foo {
def apply(a: String, b: String) = new Foo(a, b.toInt)
}
val format = jsonFormat6(new {
def apply(a: String, b: Int): Foo = Foo(a, b)
def unapply(f: Foo) = Foo.unapply(f)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment