Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- defmodule Compiled do
- defstruct template: "", meths: []
- def process(%Compiled{template: template, meths: meths}, context) do
- data = meths
- |> Enum.map(&apply(context.serializer, &1, [context.data, context.conn]))
- |> Enum.map(&to_string/1)
- :io_lib.format(template, data) |> IO.iodata_to_binary
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement