snowhite v1.1.2 Snowhite.Helpers.Casing View Source

Link to this section Summary

Functions

Converts a module name to an HTML class.

Returns the configuration key of a module

Normalizes a module name. Elixir's module name includes a "Elixir." prefix which is removed here.

Converts a module name to a socket topic.

Link to this section Functions

Specs

class(any()) :: binary()

Converts a module name to an HTML class.

Examples

iex> class(Some.Module)
"some-module"

Returns the configuration key of a module

Examples

iex> config_key(Snowhite.Modules.Clock)
:clock
iex> config_key(Snowhite.Modules.Weather.Forecast)
:weather_forecast
Link to this function

normalize_module(module)

View Source

Normalizes a module name. Elixir's module name includes a "Elixir." prefix which is removed here.

Examples

iex> normalize_module(Some.Module)
"Some.Module"

Converts a module name to a socket topic.

Examples

iex> topic(Some.Module)
"some:module"