Lexgen.Types (lexgen v1.0.0)

Summary

Functions

Returns the default value for a given field.

Convert a ref string to a module name.

Convert a field definition to an Ecto type.

Convert a field definition to a native Elixir type.

Functions

default_value(arg1)

@spec default_value(map()) :: String.t()

Returns the default value for a given field.

If the type def already has a default key, it is returned as-is. If no explicit default value is provided, the type of the field will determine the default value.

ref_to_type(nsid, ref)

@spec ref_to_type(String.t(), String.t()) :: String.t()

Convert a ref string to a module name.

to_ecto(map)

@spec to_ecto(map()) :: String.t()

Convert a field definition to an Ecto type.

to_native(nsid, map)

@spec to_native(String.t(), map()) :: String.t()

Convert a field definition to a native Elixir type.