Encoding of primitive TOON values (nil, boolean, number, string).
Summary
Functions
Encodes a primitive value to TOON format.
Functions
Encodes a primitive value to TOON format.
Examples
iex> ToonEx.Encode.Primitives.encode(nil, ",")
"null"
iex> ToonEx.Encode.Primitives.encode(true, ",")
"true"
iex> ToonEx.Encode.Primitives.encode(false, ",")
"false"
iex> ToonEx.Encode.Primitives.encode(42, ",")
"42"
iex> ToonEx.Encode.Primitives.encode(3.14, ",")
"3.14"
iex> ToonEx.Encode.Primitives.encode("hello", ",")
"hello"
iex> ToonEx.Encode.Primitives.encode("hello world", ",")
~s("hello world")