mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 21:43:02 +12:00
24 lines
504 B
Elixir
24 lines
504 B
Elixir
defmodule Ash.OptionsHelpers do
|
|
@moduledoc """
|
|
Helpers for working with nimble options
|
|
"""
|
|
|
|
def ash_type do
|
|
{:spark_type, Ash.Type, :builtins,
|
|
[{"{:array, inner_type}", "list", "{:array, ${1:inner_type}}"}]}
|
|
end
|
|
|
|
def ash_resource do
|
|
{:spark, Ash.Resource}
|
|
end
|
|
|
|
def hide_all_except(options, keys) do
|
|
Enum.map(options, fn {key, config} ->
|
|
if key in keys do
|
|
{key, config}
|
|
else
|
|
{key, Keyword.put(config, :hide, true)}
|
|
end
|
|
end)
|
|
end
|
|
end
|