Faker v0.12.0 Faker View Source
Main module to start application with some helper functions.
Link to this section Summary
Functions
Returns application country.
Internal function to format string.
Returns application locale.
Sets application locale.
Returns application locale ready for module constract.
Returns a (pseudo) random number as an integer between the range intervals.
Returns a random bytes.
Returns a random float in the value range 0.0 =< x < 1.0.
Starts Faker with default locale.
Starts Faker with lang
locale.
Link to this section Functions
country()
View Source
country() :: atom()
country() :: atom()
Returns application country.
format(str) View Source
Internal function to format string.
It replaces "#"
to random number and "?"
to random latin letter.
locale()
View Source
locale() :: atom()
locale() :: atom()
Returns application locale.
locale(lang)
View Source
locale(atom()) :: :ok
locale(atom()) :: :ok
Sets application locale.
localize(function) View Source (macro)
mlocale()
View Source
mlocale() :: String.t()
mlocale() :: String.t()
Returns application locale ready for module constract.
random_between(left, right) View Source
Returns a (pseudo) random number as an integer between the range intervals.
Examples
iex> random_between(3, 7) in [3, 4, 5, 6, 7]
true
random_bytes(total)
View Source
random_bytes(pos_integer()) :: binary()
random_bytes(pos_integer()) :: binary()
Returns a random bytes.
random_uniform()
View Source
random_uniform() :: float()
random_uniform() :: float()
Returns a random float in the value range 0.0 =< x < 1.0.
Examples
iex> is_float(random_uniform())
true
sampler(name, data) View Source (macro)
samplerp(name, data) View Source (macro)
start()
View Source
start() :: :ok
start() :: :ok
Starts Faker with default locale.
start(lang)
View Source
start(atom()) :: :ok
start(atom()) :: :ok
Starts Faker with lang
locale.