EEx.function_from_string
You're seeing just the macro
function_from_string
, go back to EEx module for more information.
Link to this macro
function_from_string(kind, name, template, args \\ [], options \\ [])
View Source (macro)Generates a function definition from the given string.
The first argument is the kind of the generated function (:def
or :defp
).
The name
argument is the name that the generated function will have.
template
is the string containing the EEx template. args
is a list of arguments
that the generated function will accept. They will be available inside the EEx
template. options
is a list of EEx compilation options (see the module documentation).
Examples
iex> defmodule Sample do
...> require EEx
...> EEx.function_from_string(:def, :sample, "<%= a + b %>", [:a, :b])
...> end
iex> Sample.sample(1, 2)
"3"