response}) do Logger.info(response) end def log({:error, error}) do Logger.error(error) end def log(_) do Logger.error("uhh... what happened?") end end DogService.run |> DogService.log
do id |> find |> give_treat end def give_treat(%{age: age, name: name}) when age > 5 do "here ya go, #{name}" end def give_treat(_) do "here ya go, pup" end
if unquote(test), do: unquote(a), else: unquote(b) end end end Example.iif(false, IO.puts("a"), IO.puts("b")) Example.iif(true, IO.puts("a"), IO.puts("b"))