GamesEngine.Validations.NumericValidations (games_engine v0.3.1)

Functions which perform numeric validations

Summary

Functions

Ensures the input is a non-negative integer

Ensures the input is numeric

Ensures the input is within a given range

Functions

Link to this function

non_neg_integer(input)

@spec non_neg_integer(term()) :: :ok | {:error, String.t()}

Ensures the input is a non-negative integer

@spec numeric(term()) :: :ok | {:error, String.t()}

Ensures the input is numeric

Link to this function

within_range(input, min, max)

@spec within_range(term(), number(), number()) :: :ok | {:error, String.t()}

Ensures the input is within a given range