trunk v0.0.1 Trunk.State
This module defines a Trunk.State
struct and provides some helper functions for working with that state.
Link to this section Summary
Link to this section Types
Link to this section Functions
Link to this function
assign(state, key, value)
assign(state :: Trunk.State.t, key :: any, value :: any) :: map
Assigns a value to a key on the state.
Example:
iex> state.assigns[:hello]
nil
iex> state = assign(state, :hello, :world)
iex> state.assigns[:hello]
:world
Link to this function
init(info, scope, opts)
Link to this function
put_error(state, version, stage, error)
Puts an error into the error map.
Example:
iex> state.errors
nil
iex> state = put_error(state, :thumb, :transform, "Error with convert blah blah")
iex> state.errors
%{thumb: [transform: "Error with convert blah blah"]}