View Source DoIt.Helper (do_it v0.5.0)
DoIt helper functions.
Link to this section Summary
Functions
Validates if all allowed values are of the same type.
Link to this section Functions
Validates if all allowed values are of the same type.
examples
Examples
iex> DoIt.Helper.validate_list_type([0, 1, 2, 3], :integer)
true
iex> DoIt.Helper.validate_list_type([0, 1, 2.1, 3], :integer)
false
iex> DoIt.Helper.validate_list_type([0.1, 1.1, 2.1, 3.1], :float)
true
iex> DoIt.Helper.validate_list_type([0.1, 1.1, 2, 3.1], :float)
false
iex> DoIt.Helper.validate_list_type(["warn", "error", "info", "debug"], :string)
true
iex> DoIt.Helper.validate_list_type(["warn", "error", "info", 0], :string)
false
iex> DoIt.Helper.validate_list_type(["warn", "error", "info", "debug"], :unknown)
false