DiffoExample.Nbn.Util (DiffoExample v0.2.1)

Copy Markdown View Source

Diffo - TMF Service and Resource Management with a difference

Util - various utilities for NBN domain

Summary

Functions

Extracts a field value from a named item value map in a list, each value map is unwrapped with Diffo.Unwrap protocol

Generates a new random NBN identifier with the prefix

Returns whether the identifier is a valid NBN identifier

Functions

extract(items, name, field)

Extracts a field value from a named item value map in a list, each value map is unwrapped with Diffo.Unwrap protocol

Examples

iex> DiffoExample.Nbn.Util.extract([%{name: :avc, value: %{cvlan: 1}}], :avc, :cvlan) 1

identifier(prefix)

Generates a new random NBN identifier with the prefix

Examples

iex> identifier = DiffoExample.Nbn.Util.identifier("AVC") iex> DiffoExample.Nbn.Util.identifier?(identifier) true

identifier?(identifier)

Returns whether the identifier is a valid NBN identifier

Examples

iex> DiffoExample.Nbn.Util.identifier?("AVC120123456789") true iex> DiffoExample.Nbn.Util.identifier?("avc120123456789") false