Simplificator3000.EnumHelpers (Simplificator3000 v0.2.0)
This module contains functions for easier work with enumerables.
Link to this section Summary
Functions
Returns true if all elements in sub_list are present in source_list.
Returns true if at least one element in sub_list is present in source_list.
Link to this section Functions
Link to this function
contains_all?(source_list, sub_list)
Returns true if all elements in sub_list are present in source_list.
Presence is checked using Kernel.in/2.
examples
Examples
iex> Simplificator3000.EnumHelpers.contains_all?([:a, :b, :c], [:a, :b])
true
iex> Simplificator3000.EnumHelpers.contains_all?([:a, :b, :c], [:a, :d])
false
Link to this function
contains_any?(source_list, sub_list)
Returns true if at least one element in sub_list is present in source_list.
Presence is checked using Kernel.in/2.
examples
Examples
iex> Simplificator3000.EnumHelpers.contains_any?([:a, :b, :c], [:a, :d])
true
iex> Simplificator3000.EnumHelpers.contains_any?([:a, :b, :c], [:d, :e])
false