diff --git a/lib/fun_with_flags.ex b/lib/fun_with_flags.ex index 6abe65c..47ae8b9 100644 --- a/lib/fun_with_flags.ex +++ b/lib/fun_with_flags.ex @@ -7,10 +7,56 @@ defmodule FunWithFlags do See the [Usage](/fun_with_flags/readme.html#usage). """ - use FunWithFlags.EntryPoint + defmodule PrivateEntryPoint do + @moduledoc false + use FunWithFlags.EntryPoint - @impl true - def config do - {:ok, []} + @impl true + def config do + {:ok, []} + end + end + + require Logger + @deprecation_msg "Using the FunWithFlags module directly is deprecated. (TODO link to docs)" + + def enabled?(flag_name, options \\ []) do + Logger.warning(@deprecation_msg) + PrivateEntryPoint.enabled?(flag_name, options) + end + + def enable(flag_name, options \\ []) do + Logger.warning(@deprecation_msg) + PrivateEntryPoint.enable(flag_name, options) + end + + def disable(flag_name, options \\ []) do + Logger.warning(@deprecation_msg) + PrivateEntryPoint.disable(flag_name, options) + end + + def clear(flag_name, options \\ []) do + Logger.warning(@deprecation_msg) + PrivateEntryPoint.clear(flag_name, options) + end + + def all_flag_names() do + Logger.warning(@deprecation_msg) + PrivateEntryPoint.all_flag_names() + end + + def all_flags() do + Logger.warning(@deprecation_msg) + PrivateEntryPoint.all_flags() + end + + def get_flag(flag_name) do + Logger.warning(@deprecation_msg) + PrivateEntryPoint.get_flag(flag_name) + end + + def compiled_store() do + Logger.warning(@deprecation_msg) + PrivateEntryPoint.compiled_store() end end