MishkaCmsCore.Builder.FurnishingSlot (Mishka CMS Core v0.0.1)

Copy Markdown View Source

One sample <:slot> entry in a component's declared furnishing.

Its own module because a component's furnishing is a THIRD PARTY's JSON — see MishkaCmsCore.Builder.Furnishing — and a slot entry that is a string, or a map with no name, has to fail on its own rather than take the whole furnishing down with it.

attrs are written onto the slot verbatim, so this is where an <:option> says which value it carries. Only the slot's own attributes belong here; the component's are attrs on the component.

Summary

Functions

Validates one entry, returning :error rather than raising — a kit's furnishing is untrusted.

A sample %MishkaCmsCore.Builder.FurnishingSlot{} populated from defaults + type-based fallbacks.

Types

t()

@type t() :: %MishkaCmsCore.Builder.FurnishingSlot{
  attrs: map() | nil,
  body: String.t() | nil,
  name: String.t()
}

Functions

builder(attrs_or_input, error \\ false)

check(entry)

@spec check(term()) :: {:ok, t()} | :error

Validates one entry, returning :error rather than raising — a kit's furnishing is untrusted.

enforce_keys()

enforce_keys(field)

example()

A sample %MishkaCmsCore.Builder.FurnishingSlot{} populated from defaults + type-based fallbacks.

keys()

keys(field)