/actions_first_iteration.kt Secret
Created
September 27, 2020 12:50
Star
You must be signed in to star a gist
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
interface Action { | |
val name: String | |
fun execute(response: Response) | |
} | |
class Print : Action { | |
override val name: String = "print" | |
override fun execute(response: Response) { | |
println("printing ${response.value}...") | |
} | |
} | |
class Log : Action { | |
override val name: String = "log" | |
override fun execute(response: Response) { | |
println("logging ${response.value}...") | |
} | |
} | |
class WriteToFile : Action { | |
override val name: String = "write_to_file" | |
override fun execute(response: Response) { | |
println("writing to file ${response.value}...") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment