View Source Faker (Faker v0.18.0)

Main module to start application with some helper functions.

Summary

Functions

Returns application country.

Internal function to format string.

Returns application locale.

Sets application locale.

Returns application locale ready for module construct.

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.

Functions

@spec country() :: atom()

Returns application country.

@spec format(String.t()) :: String.t()

Internal function to format string.

It replaces "#" to random number and "?" to random Latin letter.

@spec locale() :: atom()

Returns application locale.

@spec locale(atom()) :: :ok

Sets application locale.

Link to this macro

localize(function)

View Source (macro)
@spec mlocale() :: String.t()

Returns application locale ready for module construct.

Link to this function

random_between(left, right)

View Source
@spec random_between(integer(), integer()) :: integer()

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
@spec random_bytes(pos_integer()) :: binary()

Returns a random bytes.

@spec random_uniform() :: float()

Returns a random float in the value range 0.0 =< x < 1.0.

Examples

iex> is_float(random_uniform())
true
Link to this macro

sampler(name, data)

View Source (macro)
Link to this macro

samplerp(name, data)

View Source (macro)
@spec start() :: :ok

Starts Faker with default locale.

@spec start(atom()) :: :ok

Starts Faker with lang locale.