Nf.Boolean (neo_faker v0.4.4)

View Source

Provides functions for generating boolean values.

This module offers a function to generate random boolean values with a configurable probability.

Summary

Functions

Returns a random boolean value.

Functions

boolean(true_ratio \\ 50)

(since 0.5.0)
@spec boolean(pos_integer()) :: boolean()

Returns a random boolean value.

By default, the function returns true or false with equal probability (50% each). An optional argument can be provided to adjust the chance of returning true.

Examples

iex> Nf.Boolean.boolean()
false

iex> Nf.Boolean.boolean(75)
true