Created
September 27, 2015 16:50
-
-
Save kittinunf/34ed8f6e3e8645c40e2f to your computer and use it in GitHub Desktop.
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
class User(val id: Int, val name: String, val age: Int, val email: String) { | |
class Deserializer : Deserializable<User> { | |
override val deserializer: (JSON) -> Result<User, Exception> = { json -> | |
::User.create. | |
map(json at "id"). | |
apply(json at "name"). | |
apply(json at "age"). | |
apply(json at "email") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment