Anu.Section (Anu v0.2.1)

Copy Markdown View Source

Represents a section in a list message.

Each section has a title and a list of Anu.Row items.

Examples

iex> rows = [Anu.Row.new("s", "Small"), Anu.Row.new("m", "Medium")]
iex> Anu.Section.new("Sizes", rows)
%Anu.Section{title: "Sizes", rows: [%Anu.Row{id: "s", title: "Small", description: nil}, %Anu.Row{id: "m", title: "Medium", description: nil}]}

Summary

Functions

Creates a new section with the given title and list of rows.

Types

t()

@type t() :: %Anu.Section{rows: [Anu.Row.t()], title: String.t()}

Functions

new(title, rows)

@spec new(String.t(), [Anu.Row.t()]) :: t()

Creates a new section with the given title and list of rows.

Examples

iex> Anu.Section.new("Pick one", [Anu.Row.new("a", "A")])
%Anu.Section{title: "Pick one", rows: [%Anu.Row{id: "a", title: "A", description: nil}]}