diff --git a/lib/macros/guarded_struct.ex b/lib/macros/guarded_struct.ex index edd6e31..27eb243 100644 --- a/lib/macros/guarded_struct.ex +++ b/lib/macros/guarded_struct.ex @@ -1240,6 +1240,7 @@ defmodule GuardedStruct do #################################################################### @spec create_error_module() :: Macro.t() + @doc false defmacro create_error_module() do quote do defmodule Error do @@ -1395,6 +1396,7 @@ defmodule GuardedStruct do end @spec conditional_field(atom(), any(), keyword(), [{:do, any()}]) :: Macro.t() + @doc false defmacro conditional_field(name, type, opts \\ [], do: block) do # type = Macro.escape(quote do: struct()) type = Macro.escape(type) @@ -1870,6 +1872,7 @@ defmodule GuardedStruct do @spec exceptions_handler({:ok, any()} | {:error, any(), any()}, module(), boolean()) :: {:ok, any()} | {:error, any(), any()} + @doc false def exceptions_handler(ouput, module, exception \\ false) def exceptions_handler({:ok, _} = successful_output, _, _), do: successful_output @@ -2506,6 +2509,7 @@ defmodule GuardedStruct do end @spec reduce_success_data_and_error_data(list(any())) :: list(any()) + @doc false def reduce_success_data_and_error_data(conds) do Enum.reduce(conds, [[], []], fn {{:ok, key, value}, opts}, [data, error] -> @@ -2688,6 +2692,7 @@ defmodule GuardedStruct do {any(), atom(), list(any()), map() | list(), atom(), :add | :edit, boolean()} ) :: list() | {any(), list(), any()} + @doc false def conditional_fields_validating_pattern( {cond_data, field, list_values, full_attrs, key, type, true} ) diff --git a/test/guarded_struct_test/core_keys_test.exs b/test/guarded_struct_test/core_keys_test.exs index 2a2140a..77efabe 100644 --- a/test/guarded_struct_test/core_keys_test.exs +++ b/test/guarded_struct_test/core_keys_test.exs @@ -893,9 +893,9 @@ defmodule MishkaDeveloperToolsTest.GuardedStruct.CoreKeysTest do # TODO: check the error of :edit {:ok, - %MishkaDeveloperToolsTest.GuardedStruct.CoreKeysTest.AllowedParentCustomDomain{ + %__MODULE__.AllowedParentCustomDomain{ id: "https://github.com/mishka-group/mishka_developer_tools", - auth: %MishkaDeveloperToolsTest.GuardedStruct.CoreKeysTest.AllowedParentCustomDomain.Auth{ + auth: %__MODULE__.AllowedParentCustomDomain.Auth{ action: "ok" }, username: "mishka" @@ -910,9 +910,9 @@ defmodule MishkaDeveloperToolsTest.GuardedStruct.CoreKeysTest do ) {:ok, - %MishkaDeveloperToolsTest.GuardedStruct.CoreKeysTest.AllowedParentCustomDomain{ + %__MODULE__.AllowedParentCustomDomain{ id: "9154b00d-4602-45c2-9562-46a2dcef257f", - auth: %MishkaDeveloperToolsTest.GuardedStruct.CoreKeysTest.AllowedParentCustomDomain.Auth{ + auth: %__MODULE__.AllowedParentCustomDomain.Auth{ action: "ok" }, username: "mishka"