Since ruby and elixir has similar syntax I have just copied from ruby/cfi.vim and renamed few things. Seems to be working with all variation of the function.
def greet(%{age: age}) when 6 < age and age < 12, do: "Hiya"
def greet(%{age: age}) when 12 < age and age < 18, do: "Whatever"
def greet(%{age: age}) when 60 < age, do: "You kids get off my lawn"
def greet(_), do: "Hello"
def greet do
"Hello"
end
Changes:
Since ruby and elixir has similar syntax I have just copied from ruby/cfi.vim and renamed few things. Seems to be working with all variation of the function.