Zot.Utils (zot v0.12.0)

View Source

Private utility functions.

Summary

Functions

Retrieves the :coerce flag from the given options.

Checks if the given value is an MFA tuple.

Checks if the given value is a relative date time tuple.

Checks if the given value is a valid path segment.

Parses an float from the given value.

Parses an integer from the given value.

Resolves the given value which can be a literal value, a function or an MFA tuple.

Pattern matches a Zot type struct, assigning its module to the given variable.

Functions

coerce_flag(opts)

@spec coerce_flag(keyword()) :: boolean() | :unsafe

Retrieves the :coerce flag from the given options.

is_mfa(value)

(macro)

Checks if the given value is an MFA tuple.

is_relative(value)

(macro)

Checks if the given value is a relative date time tuple.

is_segment(value)

(macro)

Checks if the given value is a valid path segment.

parse_float(value)

@spec parse_float(term()) :: {:ok, float()} | :error

Parses an float from the given value.

parse_integer(value)

@spec parse_integer(term()) :: {:ok, integer()} | :error

Parses an integer from the given value.

resolve(mfa)

@spec resolve(mfa()) :: term()
@spec resolve((-> term())) :: term()
@spec resolve(term()) :: term()

Resolves the given value which can be a literal value, a function or an MFA tuple.

type(var)

(macro)

Pattern matches a Zot type struct, assigning its module to the given variable.