There are a couple of options to simplify and emulate a ternary operator:
if x, do: y, else: z
Or, though it's not very idiomatic Elixir, this also works:
x && y || z
if x, do: y, else: z
Or, though it's not very idiomatic Elixir, this also works:
x && y || z