Last active
February 9, 2016 15:16
-
-
Save rtfpessoa/f4feed2ba54452d9ac1d to your computer and use it in GitHub Desktop.
Scala Implicit StackOverflow
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
case class ModelObject(foo1: String, foo2: String, foo3: String, foo4: String, foo5: String) | |
case class ApiObject(bar1: String, bar3: String, bar4: String) | |
object ModelObject { | |
implicit def toApi(m: ModelObject): ApiObject = { | |
ApiObject(m.foo1, m.foo3, m.bar1) | |
} | |
} | |
ModelObject.toApi(ModelObject("1","2","3","4","5")) // bar1 ?? what ?? StackOverflow |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment