Skip to content

Instantly share code, notes, and snippets.

@mattrob33
Created February 24, 2022 16:58
Show Gist options
  • Save mattrob33/efd852b6c641dbc407ef3a067ed4ea43 to your computer and use it in GitHub Desktop.
Save mattrob33/efd852b6c641dbc407ef3a067ed4ea43 to your computer and use it in GitHub Desktop.
data class Coffee(
val roast: Roast,
val size: Size,
val leaveRoom: Boolean
)
...
fun getCoffee(): Coffee
...
val coffee = getCoffee()
print("A ${coffee.size}, ${coffee.roast} roast coffee with ${if (coffee.leaveRoom) "" else "no "}room for cream.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment