View Source Dependents.Tree.Proxy (Dependents Tree v0.1.30)

Creates a Dependents.Tree of all local apps. Also converts a Dependents.Tree into table maps.

Link to this section Summary

Functions

Creates a Dependents.Tree of all local apps.

Converts a Dependents.Tree into table maps.

Link to this section Functions

@spec new() :: Dependents.Tree.t()

Creates a Dependents.Tree of all local apps.

examples

Examples

iex> alias Dependents.Tree.Proxy
iex> tree = Proxy.new()
iex> %{log_reset: [n1 | deps1], io_ansi_table: [n2 | deps2]} = tree
iex> Enum.all?(deps1, &is_atom/1) and Enum.all?(deps2, &is_atom/1) and
...> is_integer(n1) and is_integer(n2)
true

Converts a Dependents.Tree into table maps.

examples

Examples

iex> alias Dependents.Tree.Proxy
iex> tree = %{
...>   io_ansi_table: [3, :noaa_observations, :github_issues],
...>   map_sorter: [4, :io_ansi_table]
...> }
iex> ranks = %{io_ansi_table: 27, map_sorter: 25}
iex> maps = Proxy.to_maps(tree, ranks)
iex> [
...>   %{
...>     app: :io_ansi_table, chunk: 1,
...>     dependent_1: :noaa_observations,
...>     dependent_2: :github_issues,
...>     dependent_3: nil,
...>     dependent_4: nil,
...>     dcys: 3, deps: 2, hex: "Y", rank: 27, ver: ver_27
...>   },
...>   %{
...>     app: :map_sorter, chunk: 1,
...>     dependent_1: :io_ansi_table,
...>     dependent_2: nil,
...>     dependent_3: nil,
...>     dependent_4: nil,
...>     dcys: 4, deps: 1, hex: "Y", rank: 25, ver: ver_25
...>   }
...> ] = maps
iex> is_binary(ver_27) and is_binary(ver_25)
true