Macaw.Template.Kit.Set behaviour (macaw v0.6.0)

Copy Markdown View Source

A check set for the template kit (spec/12 §2.1): an adopter's own rule over a stacked template, run by Macaw.Template.Kit.check/3 on every stack that passes.

defmodule MyApp.SidebarLabeled do
  @behaviour Macaw.Template.Kit.Set

  @impl true
  def check(stacked) do
    for {name, %{role: :complementary, label: nil}} <- stacked.regions,
        do: {[stacked.template, :regions, name, :label], :label_required}
  end
end

Each fault names its layer as Macaw.Template.stack/3's do: its path starts with the layer's name.

Summary

Callbacks

The faults of a stacked template by the set's rule, [] for none.

Callbacks

check(t)

@callback check(Macaw.Template.Stacked.t()) :: [Macaw.Base.Fault.t()]

The faults of a stacked template by the set's rule, [] for none.