fitz v0.1.1 Fitz.Enum
Documentation for Fitz.Enum.
Link to this section Summary
Functions
Enum add index. Adds an index to a list and converts it to a map
Examples
Enum add index. Gets all the keys from a list of hashes [maps/keywords_lists]
Examples
Enum add index. Zips a list of lists and converts the results the lists
Examples
Link to this section Functions
Link to this function
add_index(enum)
Enum add index. Adds an index to a list and converts it to a map
Examples
iex> params = [1,2,3,4,5]
[1,2,3,4,5]
iex> Fitz.Enum.add_index(params)
{0 => 1, 1 => 2, 2 => 3, 3 => 4, 4 => 5}
Link to this function
all_keys(list)
Enum add index. Gets all the keys from a list of hashes [maps/keywords_lists]
Examples
iex> params = [%{"per_page" => 20, "page_weight" => 50}, %{"page" => 3, "page_weight" => 90}]
[%{"per_page" => 20, "page_weight" => 50}, %{"page" => 3, "page_weight" => 90}]
iex> Fitz.Enum.all_keys(params)
["per_page", "page_weight", "page"]
Link to this function
zip(list)
Enum add index. Zips a list of lists and converts the results the lists
Examples
iex> params = [[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5]]
[[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5]]
iex> Fitz.Enum.zip(params)
[[1, 1, 1], [2, 2, 2], [3, 3, 3], [4, 4, 4], [5, 5, 5]]