View Source IO.ANSI.Table.Spec.Headings (IO ANSI Table v1.0.34)

Derives the headings of a table.

Summary

Functions

Derives the headings of a table.

Functions

@spec derive_and_put(IO.ANSI.Table.Spec.t()) :: IO.ANSI.Table.Spec.t()

Derives the headings of a table.

Examples

iex> alias IO.ANSI.Table.Spec.Headings
iex> alias IO.ANSI.Table.Spec
iex> spec = Spec.new([:c4, :c1, :c2], sort_specs: [:c4])
iex> %Spec{headings: headings} = Headings.derive_and_put(spec)
iex> headings
["C4↑", "C1", "C2"]

iex> alias IO.ANSI.Table.Spec.Headings
iex> alias IO.ANSI.Table.Spec
iex> spec = Spec.new(
...>   ["station_id", "wind_mph"],
...>   sort_specs: ["station_id"],
...>   header_fixes: %{"Id" => "ID", "Mph" => "MPH"}
...> )
iex> %Spec{headings: headings} = Headings.derive_and_put(spec)
iex> headings
["Station ID↑", "Wind MPH"]