Module ebus_common

Common utilities.

Description

Common utilities.

Function Index

build_name/1Equivalent to build_name(L, <<"_">>).
build_name/2 Build a name given the list of terms, then they are transformed to binary and concatenated by Separator.
keyfind/2Equivalent to keyfind(Key, TupleList, nil).
keyfind/3 Searches into the list of tuples TupleList for a tuple whose Nth element compares equal to Key.
rand_elem/1Returns a random element from given list L.
to_atom/1Converts any type to atom.
to_bin/1Converts any type to binary.
to_float/1Converts any type to float.
to_int/1Converts any type to integer.
to_list/1Converts any type to list.

Function Details

build_name/1

build_name(L) -> any()

Equivalent to build_name(L, <<"_">>).

build_name/2

build_name(L::[any()], Separator::iodata()) -> atom()

Build a name given the list of terms, then they are transformed to binary and concatenated by Separator.

keyfind/2

keyfind(Key, TupleList) -> any()

Equivalent to keyfind(Key, TupleList, nil).

keyfind/3

keyfind(Key::term(), TupleList::[tuple()], Default::term()) -> term()

Searches into the list of tuples TupleList for a tuple whose Nth element compares equal to Key. Returns Tuple's value if such a tuple is found, otherwise Default.

rand_elem/1

rand_elem(L::[term()]) -> term()

Returns a random element from given list L.

to_atom/1

to_atom(Data::any()) -> atom()

Converts any type to atom.

to_bin/1

to_bin(Data::any()) -> binary()

Converts any type to binary.

to_float/1

to_float(Data::any()) -> float()

Converts any type to float.

to_int/1

to_int(Data::any()) -> integer()

Converts any type to integer.

to_list/1

to_list(Data::any()) -> list()

Converts any type to list.


Generated by EDoc