| 1 |
/* |
| 2 |
Copyright 2015 Google Inc. All rights reserved. |
| 3 |
|
| 4 |
Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 |
you may not use this file except in compliance with the License. |
| 6 |
You may obtain a copy of the License at |
| 7 |
|
| 8 |
http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
|
| 10 |
Unless required by applicable law or agreed to in writing, software |
| 11 |
distributed under the License is distributed on an "AS IS" BASIS, |
| 12 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 |
See the License for the specific language governing permissions and |
| 14 |
limitations under the License. |
| 15 |
*/ |
| 16 |
|
| 17 |
local templates = import 'templates.libsonnet'; |
| 18 |
|
| 19 |
{ |
| 20 |
// The template requires us to override |
| 21 |
// the 'spirit'. |
| 22 |
'Whiskey Sour': templates.Sour { |
| 23 |
spirit: 'Whiskey', |
| 24 |
}, |
| 25 |
|
| 26 |
// Specialize it further. |
| 27 |
'Deluxe Sour': self['Whiskey Sour'] { |
| 28 |
// Don't replace the whole sweetner, |
| 29 |
// just change 'kind' within it. |
| 30 |
sweetener+: { kind: 'Gomme Syrup' }, |
| 31 |
}, |
| 32 |
|
| 33 |
Daiquiri: templates.Sour { |
| 34 |
spirit: 'Banks 7 Rum', |
| 35 |
citrus+: { kind: 'Lime' }, |
| 36 |
// Any field can be overridden. |
| 37 |
garnish: 'Lime wedge', |
| 38 |
}, |
| 39 |
|
| 40 |
"Nor'Easter": templates.Sour { |
| 41 |
spirit: 'Whiskey', |
| 42 |
citrus: { kind: 'Lime', qty: 0.5 }, |
| 43 |
sweetener+: { kind: 'Maple Syrup' }, |
| 44 |
// +: Can also add to a list. |
| 45 |
ingredients+: [ |
| 46 |
{ kind: 'Ginger Beer', qty: 1 }, |
| 47 |
], |
| 48 |
}, |
| 49 |
} |