View Source AshPyro.Extensions.Resource.Transformers (AshPyro v0.2.1)
Tooling for Ash resource transformation.
Summary
Functions
Extract a default humanized label from an entity name.
Get a filtered list of actions from the resource DSL.
Get a specific action from the resource DSL.
Safely get nested values from maps or keyword lists that may be nil
or an otherwise non-map value at any point. Great for accessing nested assigns in a template.
Collect all accumulated errors and log raise them all at once.
Inherit a value from another enitity by name.
Get the type of a resources field. Used to determine how to render it in the UI.
Functions
Extract a default humanized label from an entity name.
Get a filtered list of actions from the resource DSL.
Get a specific action from the resource DSL.
Safely get nested values from maps or keyword lists that may be nil
or an otherwise non-map value at any point. Great for accessing nested assigns in a template.
Examples
iex> get_nested(nil, [:one, :two, :three])
nil
iex> get_nested(%{one: nil}, [:one, :two, :three])
nil
iex> get_nested(%{one: %{two: %{three: 3}}}, [:one, :two, :three])
3
iex> get_nested(%{one: %{two: [three: 3]}}, [:one, :two, :three])
3
iex> get_nested([one: :nope], [:one, :two, :three])
nil
iex> get_nested([one: :nope], [:one, :two, :three], :default)
:default
Collect all accumulated errors and log raise them all at once.
Inherit a value from another enitity by name.
Get the type of a resources field. Used to determine how to render it in the UI.