View Source Magma.Matter.Text (Magma v0.2.0)
Summary
Functions
Returns the text type module for the given string.
Returns the text type name for the given text module.
Types
@type type() :: module()
Functions
Returns the text type module for the given string.
Example
iex> Magma.Matter.Text.type("UserGuide")
Magma.Matter.Texts.UserGuide
iex> Magma.Matter.Text.type("Generic")
Magma.Matter.Texts.Generic
iex> Magma.Matter.Text.type("Vault")
nil
iex> Magma.Matter.Text.type("NonExisting")
nil
Returns the text type name for the given text module.
Example
iex> Magma.Matter.Text.type_name(Magma.Matter.Texts.UserGuide)
"UserGuide"
iex> Magma.Matter.Text.type_name(Magma.Matter.Texts.Generic)
"Generic"
iex> Magma.Matter.Text.type_name(Magma.Vault)
** (RuntimeError) Invalid Magma.Matter.Text type: Magma.Vault
iex> Magma.Matter.Text.type_name(NonExisting)
** (RuntimeError) Invalid Magma.Matter.Text type: NonExisting