Faker Elixir (octopus) v1.0.2 FakerElixir.Boolean

Generate fake data for the domain boolean

Summary

Functions

Return a boolean with equal chance to be true or false

Return a boolean with a ratio chance to be true

Functions

boolean()

Return a boolean with equal chance to be true or false

Examples

iex> FakerElixir.Boolean.boolean
true
boolean(ratio)

Return a boolean with a ratio chance to be true

Examples

It will be always true:

iex> FakerElixir.Boolean.boolean(1)
true

It will be always false:

iex> FakerElixir.Boolean.boolean(0)
false

10% chance to be true:

iex> FakerElixir.Boolean.boolean(0.1)
false

90% chance to be true:

iex> FakerElixir.Boolean.boolean(0.9)
true