NeoFaker.Blood (neo_faker v0.7.1)
View SourceProvides functions for generating blood types.
This module includes functions to generate random blood groups, blood types, and Rh factors.
Summary
Functions
Generates a random blood group.
Generates a random Rh factor.
Generates a random blood type.
Functions
@spec group() :: String.t()
Generates a random blood group.
A blood group consists of a blood type (A
, B
, AB
, or O
) combined with an Rh factor
(+
or -
), forming a complete blood group.
Examples
iex> NeoFaker.Blood.group()
"B+"
@spec rh_factor() :: String.t()
Generates a random Rh factor.
The Rh factor is either +
(positive) or -
(negative).
Examples
iex> NeoFaker.Blood.rh_factor()
"+"
@spec type() :: String.t()
Generates a random blood type.
A blood type is one of A
, B
, AB
, or O
, without the Rh factor.
Examples
iex> NeoFaker.Blood.type()
"B"