Treeprit.run_if_env
You're seeing just the function
run_if_env
, go back to Treeprit module for more information.
Specs
run_if_env( %Treeprit{ errors: term(), failed_operations: term(), names: term(), operations: term(), results: term(), skipped_operations: term(), successful_operations: term(), total_operations: term() }, atom(), atom() | function(), [atom()] | atom() ) :: %Treeprit{ errors: term(), failed_operations: term(), names: term(), operations: term(), results: term(), skipped_operations: term(), successful_operations: term(), total_operations: term() }
Run if environment satisfy the condition
Examples
iex> Treeprit.new() |> Treeprit.run_if_env(:first, fn _ -> {:ok, "dev_env"} end, [:dev]) |> Treeprit.finally()
%Treeprit{
results: %{
first: "dev_env",
},
errors: %{},
successful_operations: 1,
failed_operations: 0,
skipped_operations: 0,
total_operations: 1
}