Altex.Persistable protocol (Altex.Repo v0.1.0) View Source

A protocol for all data types handled in Altex.Entity and Altex.Repo

Link to this section Summary

Functions

Get the value of key from data assuming there is an implementation of the get-function of the Persistable protocol.

Setup, sanitize, or normalize args or return them unchanged

Check all fields of the entity and add errors to entity.errors if there are any. The entity must implement the validate/2 function from the Persistable protocol.

Link to this section Types

Link to this section Functions

Specs

get(any(), atom() | String.t()) :: any()

Get the value of key from data assuming there is an implementation of the get-function of the Persistable protocol.

Specs

init(any()) :: Altex.Entity.t()

Setup, sanitize, or normalize args or return them unchanged

Specs

validate(any(), Altex.Entity.t()) :: Altex.Entity.t()

Check all fields of the entity and add errors to entity.errors if there are any. The entity must implement the validate/2 function from the Persistable protocol.