I've almost written "|> case do" several times and then in each case have decided that it makes sense to a separate private function (with function head matching for the different cases).
I don't think it's dynamic, just macros. a |> foo() |> def do ... end just gets macroexpanded to foo(a) |> def do ... end and then def foo(a) do ... end.