Class: Composition

Composition()

Collection of ingredients

Constructor

new Composition()

Source:

Methods

add(id, component)

Add a Component to Composition

Parameters:
Name Type Description
id string
component Component
Source:

component(id) → {Component|null}

Get Component from Composition

Parameters:
Name Type Description
id string
Source:
Returns:
Type
Component | null

info(precisionopt) → {CompositionInfo}

Get info (for real volume)

Parameters:
Name Type Attributes Description
precision number <optional>
Source:
Returns:
Type
CompositionInfo

reference() → {CompositionInfo}

Get reference info (per 1L)

Source:
Returns:
Type
CompositionInfo

remove(id)

Remove Component from Composition

Parameters:
Name Type Description
id string
Source:

scale(k) → {void}

Scale quantities of all Components by K

Parameters:
Name Type Description
k number
Source:
Returns:
Type
void

scaleTo(quantity, measure) → {void}

Scale quantities of all Components to total measure

Parameters:
Name Type Description
quantity number
measure MeasureVariant
Source:
Returns:
Type
void

total(measure) → {void}

Get total quantity of all Components with a specific measure

Parameters:
Name Type Description
measure MeasureVariant
Source:
Returns:
Type
void