Stopsel.Message (stopsel v0.1.0) View Source

Represents a text message.

A message has the original content, against which was matched against, assigns and parameters.

Assigns can be arbitrarily added to the message, parameters on the other are assigned from the Stopsel.Invoker and contain the parameters that were declared in the matching route.

Link to this section Summary

Functions

Adds many assigns or overwrites them.

Adds an assign to the message or overwrites it.

Prevents a message from advancing further down the pipeline.

Adds an parameter to the message or overwrites it.

Adds many parametewrs or overwrites them.

Link to this section Types

Specs

assigns() :: map()

Specs

content() :: String.t()

Specs

halted_message() :: %Stopsel.Message{
  assigns: assigns(),
  content: content(),
  halted?: true,
  params: params()
}

Specs

params() :: map()

Specs

t() :: %Stopsel.Message{
  assigns: assigns(),
  content: content(),
  halted?: boolean(),
  params: params()
}

Link to this section Functions

Link to this function

assign(message, new_assigns)

View Source

Specs

assign(t(), map() | Keyword.t()) :: t()

Adds many assigns or overwrites them.

Link to this function

assign(message, key, value)

View Source

Specs

assign(t(), atom(), term()) :: t()

Adds an assign to the message or overwrites it.

Specs

halt(t()) :: halted_message()

Prevents a message from advancing further down the pipeline.

Link to this function

put_param(message, key, value)

View Source

Specs

put_param(t(), atom(), term()) :: t()

Adds an parameter to the message or overwrites it.

Link to this function

put_params(message, new_params)

View Source

Specs

put_params(t(), map() | Keyword.t()) :: t()

Adds many parametewrs or overwrites them.