ex_uc v1.0.3 ExUc.Kind behaviour

Behaviour for a set of units of the same type with conversion among them. Every kind can be extended or overriden in configuration files.

Summary

Macros

Common methods for Kind

Callbacks

Gets a map where each conversion is a composed by the pair key:conversion, where key is an atom with the pattern <UNIT_FROM>_to_<UNIT_TO>, and conversion could be a number, or a closure, or an atom

Gets a keyword where every item is conformed by the unit identifier and a list of aliases

Macros

__using__()

Common methods for Kind

Callbacks

conversions()
conversions :: Keyword.t

Gets a map where each conversion is a composed by the pair key:conversion, where key is an atom with the pattern <UNIT_FROM>_to_<UNIT_TO>, and conversion could be a number, or a closure, or an atom.

Numeric conversions describe multiplication factors, and can be also used as <B>_to_<A>: 1 / conversion for a <A>_to_<B>: factor without explicit definition.

When a factor is not enough, a closure can be used as a simple formula.

For special cases use an atom to describe a function in module Special.

Tip: Althought the more direct conversions defined, the better performance is achieved, but every relation is not required, just the ones conecting every unit as a graph.

units()
units :: Keyword.t

Gets a keyword where every item is conformed by the unit identifier and a list of aliases