Skip to content

Instantly share code, notes, and snippets.

@orangy
Last active August 29, 2015 14:03
Show Gist options
  • Save orangy/fd54b17ee6b1848e6b0c to your computer and use it in GitHub Desktop.
Save orangy/fd54b17ee6b1848e6b0c to your computer and use it in GitHub Desktop.
class JsonObject {
fun get(name : String) : JsonObject {
}
}
class JsonPathBuilder() {
fun String.div(name : String) : JsonPath {
}
fun JsonPath.div(name : String) : JsonPath {
}
fun JsonPath.div(item : JsonPath) : JsonPath {
}
} fun item(index: Int) : JsonPath {
}
}
class JsonPath() {
}
fun JsonObject.get(path: JsonPathBuilder.()-> JsonPath) {
}
fun fn(obj : JsonObject) {
obj.get { "response" / "artists" / item(0) / "name"}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment