open-pod/lib/openpod/utility/format.ex
2020-06-08 21:37:11 +00:00

10 lines
329 B
Elixir

defmodule Openpod.Utility.Format do
@moduledoc """
This module provides utility to format a string
"""
def compile(subject, replacements) do
replacements
|> Enum.reduce(subject, fn {replacement_key, replacement_value}, subject -> String.replace(subject, "{#{replacement_key}}", replacement_value) end)
end
end