Last active
October 9, 2019 07:47
-
-
Save 0xtmphey/c696f22d85c2e7efa2b1153b60418ec5 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
enum class Environment(val id: String) { | |
DEVELOPMENT("development"), | |
PRODUCTION("production"); | |
companion object { | |
fun create(env: String): Environment = | |
when (env) { | |
"development" -> DEVELOPMENT | |
"production" -> PRODUCTION | |
else -> throw Exception("Unsupported environment $env") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment