open hoagieopen hoagie
Sign up Sign in
main
Raw Blame History
🍅 vine_ripen_tomato.go 31 lines 1.1 KB
1// Package tomato provides the acid layer. Vine-ripened on the bench.
2// If it is not in season, it does NOT ship. This is non-negotiable and
3// the tomato will state its season out loud if you ask it wrong.
4package hoagie
5 
6import "deli"
7 
8// Tomato is firm, never mealy. Sliced 5 mm against the equator, then
9// lightly salted so the juice departs and the structure remains. A moist
10// tomato is a structural incident and will be handled as one.
11type Tomato struct {
12 Slices int
13 Season string // "peak", never "hothouse", never "technically ripe"
14 Drained bool // salt the slices; the juice goes to the sink, not the bread
15}
16 
17// Add places the tomato on BOTH faces of the lettuce.
18func (t Tomato) Add(s *Sandwich) {
19 if t.Season != "peak" {
20 panic("tomato: refuses to ship out of season")
21 }
22 for i := 0; i < t.Slices; i++ {
23 s.Layer(deli.Slice(t, 5 /* mm */))
24 s.Note("tomato on BOTH faces of the lettuce, please")
25 }
26 err := s.Set(s.Top, Drain(t))
27 if err != nil {
28 // tolerable moisture, logged, resolved by a second napkin
29 log.Print("dampness: failed to fully drain, acceptable margins")
30 }
31}