Warlock.ModuleUtils (warlock v0.1.2)

Link to this section Summary

Functions

Helpers for working with Module.

Gets a module name from an option or from the module when no option is given.

Replaces a fragment of a module name, e.g App.Controllers.My -> App.Schemas.My

Replaces and slices a module name, e.g App.Controllers.My -> App.Repo

Link to this section Functions

Link to this function

atom_name(module)

Helpers for working with Module.

Link to this function

name_or_option(module, opt)

Gets a module name from an option or from the module when no option is given.

Link to this function

replace_at(module, replacement, index \\ 1)

Replaces a fragment of a module name, e.g App.Controllers.My -> App.Schemas.My

The default index is 1.

Link to this function

slice_replace(module, replacement, index \\ 1)

Replaces and slices a module name, e.g App.Controllers.My -> App.Repo