Class: Component

Component(ingredient, quantity, measure)

Container for ingredient to use in Composition

Constructor

new Component(ingredient, quantity, measure)

Parameters:
Name Type Description
ingredient Ingredient
quantity number
measure Measure
Source:

Classes

Component

Methods

fget(measure, precisionopt) → {Translatable}

Get human-readable Component or Ingredient measurement with a given precision

Parameters:
Name Type Attributes Default Description
measure MeasureVariant
precision number <optional>
0.01
Source:
Returns:
Type
Translatable

get(measure) → {number}

Get Component or Ingredient measurement

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

is(constructor) → {boolean}

Whether ingredient is of this class

Usage: myComponent.is(Alcohol)

Parameters:
Name Type Description
constructor Constructor
Source:
Returns:
Type
boolean

scale(k) → {void}

Scale all ingredients by K

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