Nf.Person (neo_faker v0.6.0)

View Source

Provides functions for generating person-related information.

This module includes functions to generate random person-related information, such as names, ages, and genders.

Summary

Types

Random result in the form of a string or a list of strings

Functions

Returns a random age.

Returns a random binary gender.

Returns a random non-binary gender.

Returns a random short binary gender.

Types

random_result()

(since 0.6.0)
@type random_result() :: String.t() | [String.t()]

Random result in the form of a string or a list of strings

Functions

age(min \\ 0, max \\ 120)

(since 0.6.0)

Returns a random age.

The age is a non-negative integer between 0 and 120.

Examples

iex> Nf.Person.age()
44

iex> Nf.Person.age(7..44)
27

binary_gender(amount \\ 1)

(since 0.6.0)
@spec binary_gender(non_neg_integer()) :: random_result()

Returns a random binary gender.

The gender is either "Male" or "Female".

Examples

iex> Nf.Person.binary_gender()
"Male"

iex> Nf.Person.binary_gender(2)
["Male", "Female"]

non_binary_gender(amount \\ 1)

(since 0.6.0)
@spec non_binary_gender(non_neg_integer()) :: random_result()

Returns a random non-binary gender.

The gender is a non-binary gender, such as "Agender", "Androgyne", "Bigender", etc.

Examples

iex> Nf.Person.non_binary_gender()
"Agender"

iex> Nf.Person.non_binary_gender(2)
["Agender", "Androgyne"]

short_binary_gender(amount \\ 1)

(since 0.6.0)
@spec short_binary_gender(non_neg_integer()) :: random_result()

Returns a random short binary gender.

The gender is either "M" or "F".

Examples

iex> Nf.Person.short_binary_gender()
"F"

iex> Nf.Person.short_binary_gender(2)
["M", "F"]