Packages

Data structure validator for elixir

Current section

Files

Jump to
suexcxine_skooma lib utils.ex
Raw

lib/utils.ex

defmodule Skooma.Utils do
def typeof(self) do
cond do
is_float(self) -> "FLOAT"
is_integer(self) -> "INTEGER"
is_boolean(self) -> "BOOLEAN"
is_atom(self) -> "ATOM"
is_binary(self) -> "STRING"
is_function(self) -> "FUNCTION"
is_list(self) -> "LIST"
is_tuple(self) -> "TUPLE"
is_map(self) -> "MAP"
true -> "MYSTERY TYPE"
end
end
def to_result(bool, error_message) do
if bool do
:ok
else
{:error, error_message}
end
end
end