TypeClass.Utility.Module (TypeClass v1.2.8) View Source
Naming convention helpers to help follow TypeClass conventions
Link to this section Summary
Functions
Generate the module name for the protocol portion of the class.
Does not nest Protocol
s.
Generate the module name for the protocol portion of the class.
Does not nest Protocol
s.
Generate a submodule name. If the module already ends in the requested submodule, it will return the module name unchanged.
Link to this section Types
Specs
ast() :: tuple()
Link to this section Functions
Specs
Generate the module name for the protocol portion of the class.
Does not nest Protocol
s.
Examples
iex> to_property MyClass.Awesome
MyClass.Awesome.Property
iex> to_property MyClass.Awesome.Property
MyClass.Awesome.roperty
Specs
Generate the module name for the protocol portion of the class.
Does not nest Protocol
s.
Examples
iex> to_protocol MyClass.Awesome
MyClass.Awesome.Protocol
iex> to_protocol MyClass.Awesome.Protocol
MyClass.Awesome.Protocol
Specs
Generate a submodule name. If the module already ends in the requested submodule, it will return the module name unchanged.
Examples
iex> MyModule.Awesome |> to_submodule(Submodule)
MyModule.Awesome.Submodule
iex> MyModule.Awesome |> to_submodule("Submodule")
MyModule.Awesome.Submodule
iex> MyModule.Awesome.Submodule |> to_submodule(Submodule)
MyModule.Awesome.Submodule