View Source Tablex (tablex v0.1.1-alpha.3)

Tablex implements Decision Table. Its goal is to make domain rules easy to maintain.

Link to this section Summary

Link to this section Functions

See Tablex.Decider.decide/2.

Link to this function

decide(table, args, opts)

View Source

See Tablex.Decider.decide/3.

Link to this function

new(content, opts \\ [])

View Source
@spec new(
  String.t(),
  keyword()
) :: Tablex.Table.t()

Create a new table.

example

Example

Tablex.new("""
  F  value  || color
  1  >90    || red
  2  80..90 || orange
  3  20..79 || green
  4  <20    || blue
  """)
Link to this function

sigil_RULES(content, opts)

View Source
@spec sigil_RULES(
  String.t(),
  keyword()
) :: Tablex.Table.t()

The same as new/2.

example

Example

~RULES"""
F  value  || color
1  >90    || red
2  80..90 || orange
3  20..79 || green
4  <20    || blue
"""