Constructor
new Liqueur(alcoholopt, syrupopt)
Make a liqueur
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
alcohol |
Alcohol | null |
<optional> |
null | |
syrup |
Syrup | null |
<optional> |
null |
- Source:
Example
let CremeDeCassis = new Liqueur(
new Alcohol(0.20, Measure.VV),
new Syrup(0.400, Measure.WV),
);
Extends
Classes
Members
density
Properties:
| Name | Type | Description |
|---|---|---|
density |
number |
- Overrides:
- Source:
type
Properties:
| Name | Type | Description |
|---|---|---|
type |
IngredientType |
- Overrides:
- Source:
Methods
attr(name, valueopt) → {this}
Shorthand getter/setter for attributes
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
name |
Object.<string, any> | string | ||
value |
any |
<optional> |
- Overrides:
- Source:
Returns:
- Type
- this
Example
ingredient.attr({ name: 'syrup', type: 'fruit' }); // set multiple
ingredient.attr('name', 'syrup'); // set
ingredient.attr('name'); // get
fget(measure, precisionopt) → {string}
Get human-readable Ingredient measurment with a given precision
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
measure |
MeasureVariant | |||
precision |
number |
<optional> |
0.01 |
- Overrides:
- Source:
Returns:
- Type
- string
get(measure) → {number}
Get liqueur measurement
Available measures:
- Measure.BRIX
- Measure.DENSITY
- Measure.ABV
- Measure.CW
Other measurements can be derived from Liqueur.composition
Parameters:
| Name | Type | Description |
|---|---|---|
measure |
MeasureVariant |
- Overrides:
- Source:
Returns:
- Type
- number
make(data) → {Composition}
Make a composition
Parameters:
| Name | Type | Description |
|---|---|---|
data |
MakeFrom |
- Source:
Returns:
- Type
- Composition
Example
let HomemadeCremeDeCassis = CremeDeCassis.make({
alcohol: new Alcohol(0.4, Measure.WV)
syrup: new Syrup(1, Measure.WV)
})
(static) fromComposition(composition) → {Liqueur}
Create from composition
Parameters:
| Name | Type | Description |
|---|---|---|
composition |
Composition |
- Source:
Returns:
- Type
- Liqueur