PosexionalRow (posexional v1.2.0)

View Source

macros for defining row modules

Summary

Functions

add use Posexional on top of an elixir module to use macros to define fields

add an empty field

enforce the row fields length sum to be equal to count. Raise an exception at compile time otherwise. It's useful when you know the row length in advance.

add a field with a fixed value

sets the row matcher

add all fields from another row module

sets the row name, if no name is provided the module name will be used

add a field with a progressive_number value

sets the row separator

Functions

__using__(opts \\ [])

(macro)

add use Posexional on top of an elixir module to use macros to define fields

empty(size, opts \\ [])

(macro)

add an empty field

enforce_length(count)

(macro)

enforce the row fields length sum to be equal to count. Raise an exception at compile time otherwise. It's useful when you know the row length in advance.

field(field_name, type, size, opts \\ [])

(macro)

add a field

fixed_value(v)

(macro)

add a field with a fixed value

guesser(func)

(macro)

sets the row matcher

import_fields_from(module_name)

(macro)

add all fields from another row module

name(row_name)

(macro)

sets the row name, if no name is provided the module name will be used

progressive_number(field_name, size, opts \\ [])

(macro)

add a field with a progressive_number value

separator(row_separator)

(macro)

sets the row separator

value(field_name, size, opts \\ [])

(macro)

add a value field