Skip to content

Instantly share code, notes, and snippets.

@ikovalyov
Created March 29, 2020 14:00
Show Gist options
  • Save ikovalyov/23254363132d9785610c72e5afff1f1a to your computer and use it in GitHub Desktop.
Save ikovalyov/23254363132d9785610c72e5afff1f1a to your computer and use it in GitHub Desktop.
fun turnOnTheTeaPot(teapotService: TeaPotService) : Boolean {
teaPotService.turnOn()
return true
}
fun turnOffTheTeaPot(teapotService: TeaPotService) : Boolean {
teaPotService.turnOff()
return false
}
fun main() {
val turnOnTheTeaPot = true
val teaPotService = TeaPotService()
val teaPotTurnedOn = if (turnOnTheTeaPot) {
turnOnTheTeaPot(teaPotService)
} else {
turnOffTheTeaPot(teaPotService)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment