ExKcal.Product (ExKcal v0.0.5)

Link to this section Summary

Types

t()

Struct representing single product. Base unit for ExKcal.Products.

Amount of substance and unit it is represented in.

Functions

Calculate nutrition of two ExKcal.Products.

Link to this section Types

Specs

t() :: %ExKcal.Product{
  alcohols: ExKcal.Alcohols.t(),
  brand: String.t(),
  carbs: ExKcal.Carbs.t(),
  description: String.t(),
  fats: ExKcal.Fats.t(),
  kcal: float(),
  minerals: ExKcal.Minerals.t(),
  name: String.t(),
  note: String.t(),
  origin: [String.t()],
  produced: [String.t()],
  producer: String.t(),
  proteins: weight(),
  salt: weight(),
  vitamins: ExKcal.Vitamins.t(),
  volume: volume(),
  weight: weight()
}

Struct representing single product. Base unit for ExKcal.Products.

Specs

volume() :: {float(), :l | :dl | :ml} | {nil, :none}

Specs

weight() :: {float(), :kg | :g | :mg | :μg} | {nil, :none}

Amount of substance and unit it is represented in.

Link to this section Functions

Link to this function

sum(item1, item2)

Specs

sum(t(), t()) :: t()

Calculate nutrition of two ExKcal.Products.

Note

non-numeric values (excluding structs) are copied without change from item1.