Skip to content

Instantly share code, notes, and snippets.

@RoRoche
Created November 6, 2019 12:49
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 RoRoche/b5b081230510e2d7763e47bb17995e9e to your computer and use it in GitHub Desktop.
Save RoRoche/b5b081230510e2d7763e47bb17995e9e to your computer and use it in GitHub Desktop.
import org.json.JSONObject
class JsonRepo(private val jsonObject: JSONObject) : Repo {
override fun id(): Long = jsonObject.getLong("id")
override fun name(): String = jsonObject.getString("name")
override fun description(): String = jsonObject.getString("description")
override fun url(): String = jsonObject.getString("url")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment