ExKcal.Recipe (ExKcal v0.0.5)
ExKcal.Recipe
splits preparation task into the list
of steps.
Link to this section Summary
Functions
Delete instance of ExKcal.Recipe.Step
from ExKcal.Recipe
by its index.
Construct new instance of ExKcal.Recipe
struct.
Calculate total nutritional value of the ExKcal.Products
used in the ExKcal.Recipe
.
It returns kind of a special ExKcal.Product
instance containing sum of all of the relevant fields, from all of the used
Products.
Link to this section Types
Specs
t() :: %ExKcal.Recipe{steps: [ExKcal.Recipe.Step.t()]}
Type representing recipe.
volume()
Specs
volume() :: {float(), :l | :dl | :ml} | {nil, :none}
weight()
Specs
weight() :: {float(), :kg | :g | :mg | :μg} | {nil, :none}
Amount of substance and unit it is represented in.
Link to this section Functions
add_step(recipe, step)
Specs
add_step(t(), ExKcal.Recipe.Step.t()) :: t()
Add ExKcal.Recipe.Step
to ExKcal.Recipe
.
delete_step(recipe, step_index)
Specs
delete_step(t(), non_neg_integer()) :: t()
Delete instance of ExKcal.Recipe.Step
from ExKcal.Recipe
by its index.
new()
Specs
new() :: t()
Construct new instance of ExKcal.Recipe
struct.
total_nutrition(recipe)
Specs
total_nutrition(t()) :: %ExKcal.Product{ alcohols: term(), brand: term(), carbs: term(), description: term(), fats: term(), kcal: term(), minerals: term(), name: term(), note: term(), origin: term(), produced: term(), producer: term(), proteins: term(), salt: term(), vitamins: term(), volume: term(), weight: term() }
Calculate total nutritional value of the ExKcal.Products
used in the ExKcal.Recipe
.
It returns kind of a special ExKcal.Product
instance containing sum of all of the relevant fields, from all of the used
Products.
Notes
- Function doesn't take units into account.
- It won't recalculate
total
fields, it will sum their values.