Yamel.Encoder protocol (yamel v2.0.4) View Source

Link to this section Summary

Types

:node_level: along with :indent_size calculates the indentation. 0 - root level; 1 - 2 spaces indent; 3 - 4 spaces indent :indent_size: multiplier for indentation. Default 2 :quote: which scalar types to be surrounded by quotes :quote_type: use single quotes (' - :single) or double quotes (" - double) :empty_value: how to deal with empty ("") values: leave blank (:blank) or use quotes (:quoted - default)

t()

Link to this section Types

Specs

opts() :: %{
  :node_level => non_neg_integer(),
  :indent_size => pos_integer(),
  optional(:quote) => quotable_type()
}

:node_level: along with :indent_size calculates the indentation. 0 - root level; 1 - 2 spaces indent; 3 - 4 spaces indent :indent_size: multiplier for indentation. Default 2 :quote: which scalar types to be surrounded by quotes :quote_type: use single quotes (' - :single) or double quotes (" - double) :empty_value: how to deal with empty ("") values: leave blank (:blank) or use quotes (:quoted - default)

Specs

quotable_type() ::
  :atom | :string | :number | :integer | :float | :boolean | true

Specs

t() :: term()

Link to this section Functions

Link to this function

encode(value, opts \\ %{node_level: 0, indent_size: 2})

View Source