Yamel (yamel v1.0.4) View Source
Module to work with YAML strings in Elixir.
Link to this section Summary
Functions
Encodes a YAML term. Returns {:ok, yaml()}
where the second term is the
encoded YAML term. Otherwise, returns {:error, reason}
with reason
being a string stating the error reason.
Encodes a YAML term directly into a string, throwing an exception if the term can not be encoded.
Link to this section Types
Link to this section Functions
Specs
decode(yaml(), [decode_opt()]) :: {:ok, t()} | {:error, reason :: binary()}
Specs
decode!(yaml(), [decode_opt()]) :: t()
Specs
Encodes a YAML term. Returns {:ok, yaml()}
where the second term is the
encoded YAML term. Otherwise, returns {:error, reason}
with reason
being a string stating the error reason.
Examples
iex> Yamel.encode(["foo", "bar", "baz"])
{:ok, "- foo\n- bar\n- baz\n\n"}
Specs
Encodes a YAML term directly into a string, throwing an exception if the term can not be encoded.
Examples
iex> Yamel.encode!(["foo", "bar", "baz"])
"- foo\n- bar\n- baz\n\n"