Solid.Context (solid v1.0.0-rc.0)

View Source

Summary

Functions

Get data from context respecting the provided scope order.

Find the current value that cycle must return

Types

scope()

@type scope() :: :counter_vars | :vars | :iteration_vars

t()

@type t() :: %Solid.Context{
  counter_vars: map(),
  cycle_state: map(),
  errors: Solid.errors(),
  iteration_vars: %{optional(String.t()) => term()},
  matcher_module: module(),
  registers: map(),
  vars: map()
}

Functions

get_counter(context, name)

@spec get_counter(t(), [String.t()]) :: term() | nil

get_in(context, variable, scopes, opts \\ [])

@spec get_in(t(), Solid.Variable.t(), [scope()], keyword()) ::
  {:ok, term(), t()} | {:error, {:not_found, [term()]}, t()}

Get data from context respecting the provided scope order.

Possible scope values: :counter_vars, :vars or :iteration_vars

put_errors(context, errors)

run_cycle(context, name, values)

@spec run_cycle(t(), name :: Solid.Argument.t() | nil, values :: [Solid.Argument.t()]) ::
  {t(), Solid.Argument.t() | nil}

Find the current value that cycle must return