Nf.Helper (neo_faker v0.5.0)

View Source

Provides utility functions commonly used across modules.

Summary

Types

Path to the lib/data/ directory

Functions

Returns the absolute path to the lib/data directory.

Reads an .exs script file from the lib/data directory and returns its contents as a map.

Types

exs_path()

(since 0.4.1)
@type exs_path() :: [String.t()]

Path to the lib/data/ directory

Functions

get_data_path()

(since 0.4.1)
@spec get_data_path() :: String.t()

Returns the absolute path to the lib/data directory.

This path is useful for loading dynamic files, such as .exs scripts.

read_exs_file!(path, file_name)

(since 0.4.1)
@spec read_exs_file!(exs_path(), String.t()) :: map()

Reads an .exs script file from the lib/data directory and returns its contents as a map.