Licensir v0.5.1 TableRex.Renderer behaviour

An Elixir behaviour that defines the API Renderers should conform to, allowing for display output in a variety of formats.

Link to this section Summary

Types

Return value of the render function.

Callbacks

Returns a Map of the options and their default values required by the renderer.

Renders a passed %TableRex.Table{} struct into a string.

Link to this section Types

Link to this type

render_return()
render_return() :: {:ok, String.t()} | {:error, String.t()}

Return value of the render function.

Link to this section Callbacks

Link to this callback

default_options()
default_options() :: map()

Returns a Map of the options and their default values required by the renderer.

Link to this callback

render(table, opts)
render(
  table :: %TableRex.Table{
    columns: term(),
    default_column: term(),
    header_row: term(),
    rows: term(),
    title: term()
  },
  opts :: list()
) :: render_return()

Renders a passed %TableRex.Table{} struct into a string.