toji 2.12.0 → 2.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/example/calendar.ipynb +42 -51
  3. data/example/calendar.yaml +6 -6
  4. data/example/calendar_file.ipynb +35 -35
  5. data/example/example_core.rb +1039 -234
  6. data/example/kake_ingredient.rb +21 -15
  7. data/example/koji_ingredient.rb +31 -21
  8. data/example/{koji_making.ipynb → koji_progress.ipynb} +14 -14
  9. data/example/{koji_making.rb → koji_progress.rb} +3 -2
  10. data/example/{koji_making.yaml → koji_progress.yaml} +8 -9
  11. data/example/{koji_making_multi.ipynb → koji_progress_multi.ipynb} +21 -22
  12. data/example/{moromi.ipynb → moromi_progress.ipynb} +22 -22
  13. data/example/{moromi.rb → moromi_progress.rb} +3 -2
  14. data/example/{moromi.yaml → moromi_progress.yaml} +0 -0
  15. data/example/moto_progress.ipynb +121 -0
  16. data/example/{moto.rb → moto_progress.rb} +3 -2
  17. data/example/{moto.yaml → moto_progress.yaml} +14 -15
  18. data/example/recipe.rb +44 -32
  19. data/lib/toji.rb +4 -2
  20. data/lib/toji/calendar.rb +12 -12
  21. data/lib/toji/calendar/date_column.rb +8 -8
  22. data/lib/toji/calendar/date_row.rb +6 -6
  23. data/lib/toji/ingredient.rb +6 -2
  24. data/lib/toji/ingredient/alcohol.rb +14 -0
  25. data/lib/toji/ingredient/base.rb +12 -0
  26. data/lib/toji/ingredient/kake.rb +3 -9
  27. data/lib/toji/ingredient/koji.rb +19 -10
  28. data/lib/toji/ingredient/lactic_acid.rb +14 -0
  29. data/lib/toji/ingredient/rice.rb +51 -4
  30. data/lib/toji/ingredient/tanekoji.rb +29 -0
  31. data/lib/toji/ingredient/water.rb +18 -0
  32. data/lib/toji/ingredient/yeast.rb +21 -0
  33. data/lib/toji/processing.rb +18 -0
  34. data/lib/toji/{event → processing}/base.rb +1 -3
  35. data/lib/toji/processing/cooled_rice.rb +22 -0
  36. data/lib/toji/processing/cooled_rice_element.rb +8 -0
  37. data/lib/toji/processing/dekoji.rb +22 -0
  38. data/lib/toji/processing/dekoji_element.rb +8 -0
  39. data/lib/toji/processing/kake_processing.rb +7 -0
  40. data/lib/toji/processing/koji_processing.rb +10 -0
  41. data/lib/toji/processing/rice_processing.rb +19 -0
  42. data/lib/toji/processing/soaked_rice.rb +49 -0
  43. data/lib/toji/processing/soaked_rice_element.rb +18 -0
  44. data/lib/toji/processing/steamed_rice.rb +22 -0
  45. data/lib/toji/processing/steamed_rice_element.rb +8 -0
  46. data/lib/toji/product.rb +11 -32
  47. data/lib/toji/product/schedule_factory.rb +80 -0
  48. data/lib/toji/progress.rb +23 -0
  49. data/lib/toji/progress/base_progress.rb +37 -0
  50. data/lib/toji/progress/base_state.rb +36 -0
  51. data/lib/toji/progress/builder.rb +53 -0
  52. data/lib/toji/progress/graph.rb +11 -0
  53. data/lib/toji/{brew → progress}/graph/ab.rb +6 -6
  54. data/lib/toji/{brew → progress}/graph/bmd.rb +2 -2
  55. data/lib/toji/{brew/graph/multi_progress.rb → progress/graph/multi_progress_note.rb} +11 -11
  56. data/lib/toji/{brew/graph/progress.rb → progress/graph/progress_note.rb} +20 -18
  57. data/lib/toji/progress/koji_progress.rb +15 -0
  58. data/lib/toji/progress/koji_state.rb +23 -0
  59. data/lib/toji/{brew/moromi.rb → progress/moromi_progress.rb} +10 -6
  60. data/lib/toji/progress/moromi_state.rb +77 -0
  61. data/lib/toji/progress/moto_progress.rb +15 -0
  62. data/lib/toji/progress/moto_state.rb +31 -0
  63. data/lib/toji/progress/progress.rb +16 -0
  64. data/lib/toji/progress/state.rb +22 -0
  65. data/lib/toji/progress/state/baume_to_nihonshudo.rb +21 -0
  66. data/lib/toji/progress/state/nihonshudo_to_baume.rb +21 -0
  67. data/lib/toji/recipe.rb +51 -39
  68. data/lib/toji/recipe/ab_expect.rb +2 -2
  69. data/lib/toji/recipe/action.rb +2 -2
  70. data/lib/toji/recipe/step.rb +106 -71
  71. data/lib/toji/schedule.rb +5 -0
  72. data/lib/toji/schedule/action_schedule.rb +9 -0
  73. data/lib/toji/schedule/base.rb +9 -0
  74. data/lib/toji/schedule/kake_schedule.rb +11 -0
  75. data/lib/toji/schedule/koji_schedule.rb +11 -0
  76. data/lib/toji/schedule/rice_schedule.rb +16 -0
  77. data/lib/toji/utils.rb +43 -0
  78. data/lib/toji/version.rb +1 -1
  79. metadata +61 -47
  80. data/lib/toji/brew.rb +0 -18
  81. data/lib/toji/brew/base.rb +0 -55
  82. data/lib/toji/brew/builder.rb +0 -98
  83. data/lib/toji/brew/graph.rb +0 -11
  84. data/lib/toji/brew/koji.rb +0 -11
  85. data/lib/toji/brew/moto.rb +0 -11
  86. data/lib/toji/brew/state.rb +0 -122
  87. data/lib/toji/brew/wrapped_state.rb +0 -109
  88. data/lib/toji/event.rb +0 -5
  89. data/lib/toji/event/action_event.rb +0 -12
  90. data/lib/toji/event/kake_event.rb +0 -13
  91. data/lib/toji/event/koji_event.rb +0 -19
  92. data/lib/toji/event/rice_event.rb +0 -34
  93. data/lib/toji/ingredient/kake/actual.rb +0 -26
  94. data/lib/toji/ingredient/kake/base.rb +0 -18
  95. data/lib/toji/ingredient/kake/expected.rb +0 -40
  96. data/lib/toji/ingredient/koji/actual.rb +0 -29
  97. data/lib/toji/ingredient/koji/actual_fermentable.rb +0 -15
  98. data/lib/toji/ingredient/koji/base.rb +0 -35
  99. data/lib/toji/ingredient/koji/expected.rb +0 -45
  100. data/lib/toji/ingredient/koji/expected_fermentable.rb +0 -15
  101. data/lib/toji/ingredient/koji_rate.rb +0 -16
  102. data/lib/toji/ingredient/rice/actual_steamable.rb +0 -27
  103. data/lib/toji/ingredient/rice/base.rb +0 -40
  104. data/lib/toji/ingredient/rice/expected_steamable.rb +0 -27
  105. data/lib/toji/ingredient/rice_rate.rb +0 -23
  106. data/lib/toji/product/event_factory.rb +0 -70
@@ -1,88 +1,288 @@
1
+ $LOAD_PATH << File.dirname(__FILE__) + "/../lib"
1
2
  require 'toji'
2
3
  require 'securerandom'
3
4
 
4
5
  module Example
5
6
 
6
- module Brew
7
- class State
8
- include Toji::Brew::State
9
- include Toji::Brew::State::BaumeToNihonshudo
7
+ class Product
8
+ include Toji::Product
9
+ include Toji::Product::ScheduleFactory
10
10
 
11
- def self.create(val)
12
- s = new
13
- KEYS.each {|k|
14
- if val.has_key?(k)
15
- s.send("#{k}=", val[k])
16
- end
17
- }
18
- s
19
- end
20
- end
11
+ attr_reader :name
12
+ attr_reader :recipe
13
+ attr_reader :base_date
21
14
 
22
- module BrewGenerator
23
- def builder
24
- Toji::Brew::Builder.new(self)
25
- end
15
+ attr_reader :description
16
+ attr_reader :color
26
17
 
27
- def load_hash(hash)
28
- hash = hash.deep_symbolize_keys
18
+ def initialize(id, name, description, recipe, base_date, color=nil)
19
+ @id = id
20
+ @name = name
21
+ @description = description
22
+ @recipe = recipe
23
+ @base_date = base_date
24
+ @color = color
25
+ end
29
26
 
30
- builder
31
- .add((hash[:states] || []).map{|s| State.create(s)})
32
- .date_line(hash[:date_line] || 0, Toji::Brew::HOUR)
33
- .prefix_day_labels(hash[:prefix_day_labels])
34
- .time_interpolation(nil)
35
- .elapsed_time_interpolation
36
- .build
37
- end
27
+ def create_koji_schedule(date:, step_indexes:, kojis:)
28
+ expect = kojis.first.dup
29
+ expect.weight = kojis.map(&:weight).sum
38
30
 
39
- def load_yaml_file(fname)
40
- hash = YAML.load_file(fname)
41
- load_hash(hash)
42
- end
31
+ KojiSchedule.new(
32
+ product: self,
33
+ date: date,
34
+ step_indexes: step_indexes,
35
+ expect: expect,
36
+ )
43
37
  end
44
38
 
45
- class Base
46
- include Toji::Brew::Base
47
- extend BrewGenerator
39
+ def create_kake_schedule(date:, step_indexes:, kakes:)
40
+ expect = kakes.first.dup
41
+ expect.weight = kakes.map(&:weight).sum
48
42
 
49
- def initialize
50
- @states = []
51
- @day_offset = 0
52
- @base_time = 0
53
- end
43
+ KakeSchedule.new(
44
+ product: self,
45
+ date: date,
46
+ step_indexes: step_indexes,
47
+ expect: expect,
48
+ )
54
49
  end
55
50
 
56
- class Koji < Base
57
- include Toji::Brew::Koji
51
+ def create_action_schedule(date:, action_index:, action:)
52
+ ActionSchedule.new(
53
+ product: self,
54
+ date: date,
55
+ type: action.type,
56
+ action_index: index,
57
+ )
58
58
  end
59
59
 
60
- class Moto < Base
61
- include Toji::Brew::Moto
62
- end
60
+ def self.create(args)
61
+ if self===args
62
+ args
63
+ elsif Hash===args
64
+ recipe = args.fetch(:recipe)
65
+ if Symbol===recipe
66
+ recipe = Recipe::TEMPLATES.fetch(recipe)
67
+ end
68
+ if args[:scale_rice_total]
69
+ recipe = recipe.scale_rice_total(args[:scale_rice_total])
70
+ end
71
+ if args[:round]
72
+ recipe = recipe.round(args[:round])
73
+ end
63
74
 
64
- class Moromi < Base
65
- include Toji::Brew::Moromi
75
+ new(
76
+ args[:id],
77
+ args[:name],
78
+ args[:description],
79
+ recipe,
80
+ args[:base_date],
81
+ args[:color]
82
+ )
83
+ else
84
+ raise "not supported class: #{args.class}"
85
+ end
66
86
  end
67
87
  end
68
88
 
69
89
 
70
90
  class Step
71
91
  include Toji::Recipe::Step
72
- attr_accessor :name
73
-
74
- def self.create(name:, kake: 0, koji: 0, water: 0, lactic_acid: 0, alcohol: 0, yeast: 0, koji_interval_days: 0, kake_interval_days: 0)
75
- new.tap {|o|
76
- o.name = name
77
- o.kake = kake.to_f
78
- o.koji = koji.to_f
79
- o.water = water.to_f
80
- o.lactic_acid = lactic_acid.to_f
81
- o.alcohol = alcohol.to_f
82
- o.yeast = yeast.to_f
83
- o.koji_interval_days = koji_interval_days.to_i
84
- o.kake_interval_days = kake_interval_days.to_i
92
+
93
+ attr_reader :index
94
+ attr_reader :subindex
95
+ attr_accessor :kojis
96
+ attr_accessor :kakes
97
+ attr_accessor :waters
98
+ attr_accessor :lactic_acids
99
+ attr_accessor :alcohols
100
+ attr_accessor :yeasts
101
+
102
+ def initialize(index:, subindex:, kojis: [], kakes: [], waters: [], lactic_acids: [], alcohols: [], yeasts: [])
103
+ @index = index
104
+ @subindex = subindex
105
+ @kojis = kojis
106
+ @kakes = kakes
107
+ @waters = waters
108
+ @lactic_acids = lactic_acids
109
+ @alcohols = alcohols
110
+ @yeasts = yeasts
111
+ end
112
+
113
+ def initialize_copy(obj)
114
+ @kojis = obj.kojis.deep_dup
115
+ @kakes = obj.kakes.deep_dup
116
+ @waters = obj.waters.deep_dup
117
+ @lactic_acids = obj.lactic_acids.deep_dup
118
+ @alcohols = obj.alcohols.deep_dup
119
+ @yeasts = obj.yeasts.deep_dup
120
+ end
121
+ end
122
+
123
+ class Koji
124
+ include Toji::Ingredient::Koji
125
+
126
+ attr_accessor :weight
127
+ attr_reader :brand
128
+ attr_reader :polishing_ratio
129
+ attr_reader :made_in
130
+ attr_reader :year
131
+ attr_reader :soaking_ratio
132
+ attr_reader :steaming_ratio
133
+ attr_reader :cooling_ratio
134
+ attr_reader :tanekojis
135
+ attr_reader :dekoji_ratio
136
+ attr_reader :interval_days
137
+
138
+ def initialize(weight:, brand:, polishing_ratio:, made_in:, year:, soaking_ratio:, steaming_ratio:, cooling_ratio:, tanekojis:, dekoji_ratio:, interval_days:)
139
+ @weight = weight
140
+ @brand = brand
141
+ @polishing_ratio = polishing_ratio
142
+ @made_in = made_in
143
+ @year = year
144
+ @soaking_ratio = soaking_ratio
145
+ @steaming_ratio = steaming_ratio
146
+ @cooling_ratio = cooling_ratio
147
+ @tanekojis = tanekojis.map {|tanekoji|
148
+ tanekoji.koji = self
149
+ tanekoji
150
+ }
151
+ @dekoji_ratio = dekoji_ratio
152
+ @interval_days = interval_days
153
+ end
154
+
155
+ def initialize_copy(obj)
156
+ @weight = obj.weight.dup
157
+ @brand = obj.brand.dup
158
+ @polishing_ratio = obj.polishing_ratio.dup
159
+ @made_in = obj.made_in.dup
160
+ @year = obj.year.dup
161
+ @soaking_ratio = obj.soaking_ratio.dup
162
+ @steaming_ratio = obj.steaming_ratio.dup
163
+ @cooling_ratio = obj.cooling_ratio.dup
164
+
165
+ @tanekojis = obj.tanekojis.map {|tanekoji|
166
+ tanekoji = tanekoji.dup
167
+ tanekoji.koji = self
168
+ tanekoji
85
169
  }
170
+
171
+ @dekoji_ratio = obj.dekoji_ratio.dup
172
+ @interval_days = obj.interval_days.dup
173
+ end
174
+ end
175
+
176
+ class Tanekoji
177
+ include Toji::Ingredient::Tanekoji
178
+
179
+ attr_accessor :koji
180
+ attr_reader :brand
181
+ attr_reader :ratio
182
+
183
+ def initialize(koji: nil, brand:, ratio:)
184
+ @brand = brand
185
+ @ratio = ratio
186
+ end
187
+
188
+ def initialize_copy(obj)
189
+ @brand = obj.brand.dup
190
+ @ratio = obj.ratio.dup
191
+ end
192
+ end
193
+
194
+ class Kake
195
+ include Toji::Ingredient::Kake
196
+
197
+ attr_accessor :weight
198
+ attr_reader :brand
199
+ attr_reader :polishing_ratio
200
+ attr_reader :made_in
201
+ attr_reader :year
202
+ attr_reader :soaking_ratio
203
+ attr_reader :steaming_ratio
204
+ attr_reader :cooling_ratio
205
+ attr_reader :interval_days
206
+
207
+ def initialize(weight:, brand:, polishing_ratio:, made_in:, year:, soaking_ratio:, steaming_ratio:, cooling_ratio:, interval_days:)
208
+ @weight = weight
209
+ @brand = brand
210
+ @polishing_ratio = polishing_ratio
211
+ @made_in = made_in
212
+ @year = year
213
+ @soaking_ratio = soaking_ratio
214
+ @steaming_ratio = steaming_ratio
215
+ @cooling_ratio = cooling_ratio
216
+ @interval_days = interval_days
217
+ end
218
+ end
219
+
220
+ class Water
221
+ include Toji::Ingredient::Water
222
+
223
+ attr_accessor :weight
224
+ attr_reader :calcium_hardness
225
+ attr_reader :magnesium_hardness
226
+
227
+ def initialize(weight:)
228
+ @weight = weight
229
+ end
230
+ end
231
+
232
+ class LacticAcid
233
+ include Toji::Ingredient::LacticAcid
234
+
235
+ attr_accessor :weight
236
+
237
+ def initialize(weight:)
238
+ @weight = weight
239
+ end
240
+ end
241
+
242
+ class Alcohol
243
+ include Toji::Ingredient::Alcohol
244
+
245
+ attr_accessor :weight
246
+
247
+ def initialize(weight:)
248
+ @weight = weight
249
+ end
250
+ end
251
+
252
+ class Yeast
253
+ include Toji::Ingredient::Yeast
254
+
255
+ attr_accessor :weight
256
+ attr_reader :unit
257
+ attr_reader :brand
258
+
259
+ def initialize(weight:)
260
+ @weight = weight
261
+ end
262
+ end
263
+
264
+
265
+ class Action
266
+ include Toji::Recipe::Action
267
+
268
+ attr_reader :type
269
+ attr_reader :interval_days
270
+
271
+ def initialize(type:, interval_days:)
272
+ @type = type
273
+ @interval_days = interval_days
274
+ end
275
+ end
276
+
277
+ class AbExpect
278
+ include Toji::Recipe::AbExpect
279
+
280
+ attr_reader :alcohol
281
+ attr_reader :nihonshudo
282
+
283
+ def initialize(alcohol:, nihonshudo:)
284
+ @alcohol = alcohol
285
+ @nihonshudo = nihonshudo
86
286
  end
87
287
  end
88
288
 
@@ -90,14 +290,23 @@ module Example
90
290
  class Recipe
91
291
  include Toji::Recipe
92
292
 
93
- def initialize
94
- @steps = []
293
+ attr_reader :steps
294
+ attr_reader :actions
295
+ attr_reader :ab_coef
296
+ attr_reader :ab_expects
297
+
298
+ def initialize(steps:, actions:, ab_coef:, ab_expects:)
299
+ @steps = steps
300
+ @actions = actions
301
+ @ab_coef = ab_coef
302
+ @ab_expects = ab_expects
95
303
  end
96
304
 
97
- def self.create(steps)
98
- new.tap {|o|
99
- o.steps = steps
100
- }
305
+ def initialize_copy(obj)
306
+ @steps = obj.steps.deep_dup
307
+ @actions = obj.actions.deep_dup
308
+ @ab_coef = obj.ab_coef.dup
309
+ @ab_expects = obj.ab_expects.deep_dup
101
310
  end
102
311
 
103
312
  # 乳酸は汲水100L当たり比重1.21の乳酸(90%乳酸と称される)を650〜720ml添加する。
@@ -109,233 +318,829 @@ module Example
109
318
  TEMPLATES = {
110
319
  # 酒造教本による標準型仕込配合
111
320
  # 出典: 酒造教本 P97
112
- sokujo_textbook: create(
113
- [
114
- Step.create(
115
- name: :moto,
116
- kake: 45,
117
- koji: 20,
118
- water: 70,
119
- lactic_acid: 70/100.0*0.685,
120
- yeast: (45+20)/100.0*1.5,
121
- koji_interval_days: 0,
122
- kake_interval_days: 5,
321
+ sokujo_textbook: new(
322
+ steps: [
323
+ Step.new(
324
+ index: 0,
325
+ subindex: 0,
326
+ kojis: [
327
+ Koji.new(
328
+ weight: 20,
329
+ brand: :yamadanishiki,
330
+ polishing_ratio: 0.55,
331
+ made_in: :hyogo,
332
+ year: 2020,
333
+ soaking_ratio: 0.33,
334
+ steaming_ratio: 0.41,
335
+ cooling_ratio: 0.33,
336
+ tanekojis: [
337
+ Tanekoji.new(
338
+ brand: :byakuya,
339
+ ratio: 0.001,
340
+ ),
341
+ ],
342
+ dekoji_ratio: 0.18,
343
+ interval_days: 0,
344
+ ),
345
+ ],
346
+ kakes: [
347
+ Kake.new(
348
+ weight: 45,
349
+ brand: :yamadanishiki,
350
+ polishing_ratio: 0.55,
351
+ made_in: :hyogo,
352
+ year: 2020,
353
+ soaking_ratio: 0.33,
354
+ steaming_ratio: 0.41,
355
+ cooling_ratio: 0.33,
356
+ interval_days: 5,
357
+ ),
358
+ ],
359
+ waters: [
360
+ Water.new(
361
+ weight: 70,
362
+ ),
363
+ ],
364
+ lactic_acids: [
365
+ LacticAcid.new(
366
+ weight: 70/100.0*0.685,
367
+ ),
368
+ ],
369
+ yeasts: [
370
+ Yeast.new(
371
+ weight: (45+20)/100.0*1.5,
372
+ ),
373
+ ]
374
+ ),
375
+ Step.new(
376
+ index: 1,
377
+ subindex: 0,
378
+ kojis: [
379
+ Koji.new(
380
+ weight: 40,
381
+ brand: :yamadanishiki,
382
+ polishing_ratio: 0.55,
383
+ made_in: :hyogo,
384
+ year: 2020,
385
+ soaking_ratio: 0.33,
386
+ steaming_ratio: 0.41,
387
+ cooling_ratio: 0.33,
388
+ tanekojis: [
389
+ Tanekoji.new(
390
+ brand: :byakuya,
391
+ ratio: 0.001,
392
+ ),
393
+ ],
394
+ dekoji_ratio: 0.18,
395
+ interval_days: 14,
396
+ ),
397
+ ],
398
+ kakes: [
399
+ Kake.new(
400
+ weight: 100,
401
+ brand: :yamadanishiki,
402
+ polishing_ratio: 0.55,
403
+ made_in: :hyogo,
404
+ year: 2020,
405
+ soaking_ratio: 0.33,
406
+ steaming_ratio: 0.41,
407
+ cooling_ratio: 0.33,
408
+ interval_days: 20,
409
+ ),
410
+ ],
411
+ waters: [
412
+ Water.new(
413
+ weight: 130,
414
+ ),
415
+ ],
416
+ ),
417
+ Step.new(
418
+ index: 2,
419
+ subindex: 0,
420
+ kojis: [
421
+ Koji.new(
422
+ weight: 60,
423
+ brand: :yamadanishiki,
424
+ polishing_ratio: 0.55,
425
+ made_in: :hyogo,
426
+ year: 2020,
427
+ soaking_ratio: 0.33,
428
+ steaming_ratio: 0.41,
429
+ cooling_ratio: 0.33,
430
+ tanekojis: [
431
+ Tanekoji.new(
432
+ brand: :byakuya,
433
+ ratio: 0.001,
434
+ ),
435
+ ],
436
+ dekoji_ratio: 0.18,
437
+ interval_days: 14,
438
+ ),
439
+ ],
440
+ kakes: [
441
+ Kake.new(
442
+ weight: 215,
443
+ brand: :yamadanishiki,
444
+ polishing_ratio: 0.55,
445
+ made_in: :hyogo,
446
+ year: 2020,
447
+ soaking_ratio: 0.33,
448
+ steaming_ratio: 0.41,
449
+ cooling_ratio: 0.33,
450
+ interval_days: 22,
451
+ ),
452
+ ],
453
+ waters: [
454
+ Water.new(
455
+ weight: 330,
456
+ ),
457
+ ],
123
458
  ),
124
- Step.create(
125
- name: :soe,
126
- kake: 100,
127
- koji: 40,
128
- water: 130,
129
- koji_interval_days: 14,
130
- kake_interval_days: 15,
459
+ Step.new(
460
+ index: 3,
461
+ subindex: 0,
462
+ kojis: [
463
+ Koji.new(
464
+ weight: 80,
465
+ brand: :yamadanishiki,
466
+ polishing_ratio: 0.55,
467
+ made_in: :hyogo,
468
+ year: 2020,
469
+ soaking_ratio: 0.33,
470
+ steaming_ratio: 0.41,
471
+ cooling_ratio: 0.33,
472
+ tanekojis: [
473
+ Tanekoji.new(
474
+ brand: :byakuya,
475
+ ratio: 0.001,
476
+ ),
477
+ ],
478
+ dekoji_ratio: 0.18,
479
+ interval_days: 14,
480
+ ),
481
+ ],
482
+ kakes: [
483
+ Kake.new(
484
+ weight: 360,
485
+ brand: :yamadanishiki,
486
+ polishing_ratio: 0.55,
487
+ made_in: :hyogo,
488
+ year: 2020,
489
+ soaking_ratio: 0.33,
490
+ steaming_ratio: 0.41,
491
+ cooling_ratio: 0.33,
492
+ interval_days: 23,
493
+ ),
494
+ ],
495
+ waters: [
496
+ Water.new(
497
+ weight: 630,
498
+ ),
499
+ ],
131
500
  ),
132
- Step.create(
133
- name: :naka,
134
- kake: 215,
135
- koji: 60,
136
- water: 330,
137
- koji_interval_days: 0,
138
- kake_interval_days: 2,
501
+ Step.new(
502
+ index: 4,
503
+ subindex: 0,
504
+ kakes: [
505
+ Kake.new(
506
+ weight: 80,
507
+ brand: :yamadanishiki,
508
+ polishing_ratio: 0.55,
509
+ made_in: :hyogo,
510
+ year: 2020,
511
+ soaking_ratio: 0.33,
512
+ steaming_ratio: 0.41,
513
+ cooling_ratio: 0.33,
514
+ interval_days: 48,
515
+ ),
516
+ ],
517
+ waters: [
518
+ Water.new(
519
+ weight: 120,
520
+ ),
521
+ ],
139
522
  ),
140
- Step.create(
141
- name: :tome,
142
- kake: 360,
143
- koji: 80,
144
- water: 630,
145
- koji_interval_days: 0,
146
- kake_interval_days: 1,
523
+ ].map(&:freeze).freeze,
524
+ actions: [
525
+ Action.new(
526
+ type: :squeeze,
527
+ interval_days: 50,
147
528
  ),
148
- Step.create(
149
- name: :yodan,
150
- kake: 80,
151
- water: 120,
152
- kake_interval_days: 25,
529
+ ].map(&:freeze).freeze,
530
+ ab_coef: 1.4,
531
+ ab_expects: [
532
+ AbExpect.new(
533
+ alcohol: 15.0,
534
+ nihonshudo: 0.0,
153
535
  ),
154
- ].map(&:freeze).freeze
536
+ AbExpect.new(
537
+ alcohol: 16.0,
538
+ nihonshudo: 3.0,
539
+ ),
540
+ ].map(&:freeze).freeze,
155
541
  ).freeze,
156
542
  # 灘における仕込配合の平均値
157
543
  # 出典: http://www.nada-ken.com/main/jp/index_shi/234.html
158
- sokujo_nada: create(
159
- [
160
- Step.create(
161
- name: :moto,
162
- kake: 93,
163
- koji: 47,
164
- water: 170,
165
- lactic_acid: 170/100.0*0.685,
166
- yeast: (93+47)/100.0*1.5,
167
- koji_interval_days: 0,
168
- kake_interval_days: 5,
544
+ sokujo_nada: new(
545
+ steps: [
546
+ Step.new(
547
+ index: 0,
548
+ subindex: 0,
549
+ kojis: [
550
+ Koji.new(
551
+ weight: 47,
552
+ brand: :yamadanishiki,
553
+ polishing_ratio: 0.55,
554
+ made_in: :hyogo,
555
+ year: 2020,
556
+ soaking_ratio: 0.33,
557
+ steaming_ratio: 0.41,
558
+ cooling_ratio: 0.33,
559
+ tanekojis: [
560
+ Tanekoji.new(
561
+ brand: :byakuya,
562
+ ratio: 0.001,
563
+ ),
564
+ ],
565
+ dekoji_ratio: 0.18,
566
+ interval_days: 0,
567
+ ),
568
+ ],
569
+ kakes: [
570
+ Kake.new(
571
+ weight: 93,
572
+ brand: :yamadanishiki,
573
+ polishing_ratio: 0.55,
574
+ made_in: :hyogo,
575
+ year: 2020,
576
+ soaking_ratio: 0.33,
577
+ steaming_ratio: 0.41,
578
+ cooling_ratio: 0.33,
579
+ interval_days: 5,
580
+ ),
581
+ ],
582
+ waters: [
583
+ Water.new(
584
+ weight: 170,
585
+ ),
586
+ ],
587
+ lactic_acids: [
588
+ LacticAcid.new(
589
+ weight: 170/100.0*0.685,
590
+ ),
591
+ ],
592
+ yeasts: [
593
+ Yeast.new(
594
+ weight: (93+47)/100.0*1.5,
595
+ ),
596
+ ],
597
+ ),
598
+ Step.new(
599
+ index: 1,
600
+ subindex: 0,
601
+ kojis: [
602
+ Koji.new(
603
+ weight: 99,
604
+ brand: :yamadanishiki,
605
+ polishing_ratio: 0.55,
606
+ made_in: :hyogo,
607
+ year: 2020,
608
+ soaking_ratio: 0.33,
609
+ steaming_ratio: 0.41,
610
+ cooling_ratio: 0.33,
611
+ tanekojis: [
612
+ Tanekoji.new(
613
+ brand: :byakuya,
614
+ ratio: 0.001,
615
+ ),
616
+ ],
617
+ dekoji_ratio: 0.18,
618
+ interval_days: 14,
619
+ ),
620
+ ],
621
+ kakes: [
622
+ Kake.new(
623
+ weight: 217,
624
+ brand: :yamadanishiki,
625
+ polishing_ratio: 0.55,
626
+ made_in: :hyogo,
627
+ year: 2020,
628
+ soaking_ratio: 0.33,
629
+ steaming_ratio: 0.41,
630
+ cooling_ratio: 0.33,
631
+ interval_days: 20,
632
+ ),
633
+ ],
634
+ waters: [
635
+ Water.new(
636
+ weight: 270,
637
+ ),
638
+ ],
639
+ ),
640
+ Step.new(
641
+ index: 2,
642
+ subindex: 0,
643
+ kojis: [
644
+ Koji.new(
645
+ weight: 143,
646
+ brand: :yamadanishiki,
647
+ polishing_ratio: 0.55,
648
+ made_in: :hyogo,
649
+ year: 2020,
650
+ soaking_ratio: 0.33,
651
+ steaming_ratio: 0.41,
652
+ cooling_ratio: 0.33,
653
+ tanekojis: [
654
+ Tanekoji.new(
655
+ brand: :byakuya,
656
+ ratio: 0.001,
657
+ ),
658
+ ],
659
+ dekoji_ratio: 0.18,
660
+ interval_days: 14,
661
+ ),
662
+ ],
663
+ kakes: [
664
+ Kake.new(
665
+ weight: 423,
666
+ brand: :yamadanishiki,
667
+ polishing_ratio: 0.55,
668
+ made_in: :hyogo,
669
+ year: 2020,
670
+ soaking_ratio: 0.33,
671
+ steaming_ratio: 0.41,
672
+ cooling_ratio: 0.33,
673
+ interval_days: 22,
674
+ ),
675
+ ],
676
+ waters: [
677
+ Water.new(
678
+ weight: 670,
679
+ ),
680
+ ],
169
681
  ),
170
- Step.create(
171
- name: :soe,
172
- kake: 217,
173
- koji: 99,
174
- water: 270,
175
- koji_interval_days: 14,
176
- kake_interval_days: 15,
682
+ Step.new(
683
+ index: 3,
684
+ subindex: 0,
685
+ kojis: [
686
+ Koji.new(
687
+ weight: 165,
688
+ brand: :yamadanishiki,
689
+ polishing_ratio: 0.55,
690
+ made_in: :hyogo,
691
+ year: 2020,
692
+ soaking_ratio: 0.33,
693
+ steaming_ratio: 0.41,
694
+ cooling_ratio: 0.33,
695
+ tanekojis: [
696
+ Tanekoji.new(
697
+ brand: :byakuya,
698
+ ratio: 0.001,
699
+ ),
700
+ ],
701
+ dekoji_ratio: 0.18,
702
+ interval_days: 14,
703
+ ),
704
+ ],
705
+ kakes: [
706
+ Kake.new(
707
+ weight: 813,
708
+ brand: :yamadanishiki,
709
+ polishing_ratio: 0.55,
710
+ made_in: :hyogo,
711
+ year: 2020,
712
+ soaking_ratio: 0.33,
713
+ steaming_ratio: 0.41,
714
+ cooling_ratio: 0.33,
715
+ interval_days: 23,
716
+ ),
717
+ ],
718
+ waters: [
719
+ Water.new(
720
+ weight: 1330,
721
+ ),
722
+ ],
177
723
  ),
178
- Step.create(
179
- name: :naka,
180
- kake: 423,
181
- koji: 143,
182
- water: 670,
183
- koji_interval_days: 0,
184
- kake_interval_days: 2,
724
+ Step.new(
725
+ index: 4,
726
+ subindex: 0,
727
+ alcohols: [
728
+ Alcohol.new(
729
+ weight: 900,
730
+ ),
731
+ ],
185
732
  ),
186
- Step.create(
187
- name: :tome,
188
- kake: 813,
189
- koji: 165,
190
- water: 1330,
191
- koji_interval_days: 0,
192
- kake_interval_days: 1,
733
+ ].map(&:freeze).freeze,
734
+ actions: [
735
+ Action.new(
736
+ type: :squeeze,
737
+ interval_days: 50,
193
738
  ),
194
- Step.create(
195
- name: :alcohol,
196
- alcohol: 900
739
+ ].map(&:freeze).freeze,
740
+ ab_coef: 1.4,
741
+ ab_expects: [
742
+ AbExpect.new(
743
+ alcohol: 15.0,
744
+ nihonshudo: 0.0,
197
745
  ),
198
- ].map(&:freeze).freeze
746
+ AbExpect.new(
747
+ alcohol: 16.0,
748
+ nihonshudo: 3.0,
749
+ ),
750
+ ].map(&:freeze).freeze,
199
751
  ).freeze,
200
752
  # 簡易酒母省略仕込
201
753
  # 出典: https://www.jstage.jst.go.jp/article/jbrewsocjapan1915/60/11/60_11_999/_article/-char/ja/
202
- simple_sokujo_himeno: create(
203
- [
204
- Step.create(
205
- name: :moto,
206
- kake: 0,
207
- koji: 70,
208
- water: 245,
209
- lactic_acid: 1.6,
210
- yeast: 5,
211
- koji_interval_days: 0,
212
- kake_interval_days: 6,
754
+ simple_sokujo_himeno: new(
755
+ steps: [
756
+ Step.new(
757
+ index: 0,
758
+ subindex: 0,
759
+ kojis: [
760
+ Koji.new(
761
+ weight: 70,
762
+ brand: :yamadanishiki,
763
+ polishing_ratio: 0.55,
764
+ made_in: :hyogo,
765
+ year: 2020,
766
+ soaking_ratio: 0.33,
767
+ steaming_ratio: 0.41,
768
+ cooling_ratio: 0.33,
769
+ tanekojis: [
770
+ Tanekoji.new(
771
+ brand: :byakuya,
772
+ ratio: 0.001,
773
+ ),
774
+ ],
775
+ dekoji_ratio: 0.18,
776
+ interval_days: 0,
777
+ ),
778
+ ],
779
+ kakes: [
780
+ ],
781
+ waters: [
782
+ Water.new(
783
+ weight: 245,
784
+ ),
785
+ ],
786
+ lactic_acids: [
787
+ LacticAcid.new(
788
+ weight: 1.6,
789
+ ),
790
+ ],
791
+ yeasts: [
792
+ Yeast.new(
793
+ weight: 5,
794
+ ),
795
+ ],
796
+ ),
797
+ Step.new(
798
+ index: 1,
799
+ subindex: 0,
800
+ kojis: [
801
+ ],
802
+ kakes: [
803
+ Kake.new(
804
+ weight: 130,
805
+ brand: :yamadanishiki,
806
+ polishing_ratio: 0.55,
807
+ made_in: :hyogo,
808
+ year: 2020,
809
+ soaking_ratio: 0.33,
810
+ steaming_ratio: 0.41,
811
+ cooling_ratio: 0.33,
812
+ interval_days: 7,
813
+ ),
814
+ ],
815
+ waters: [
816
+ Water.new(
817
+ weight: 0,
818
+ ),
819
+ ],
820
+ ),
821
+ Step.new(
822
+ index: 2,
823
+ subindex: 0,
824
+ kojis: [
825
+ Koji.new(
826
+ weight: 100,
827
+ brand: :yamadanishiki,
828
+ polishing_ratio: 0.55,
829
+ made_in: :hyogo,
830
+ year: 2020,
831
+ soaking_ratio: 0.33,
832
+ steaming_ratio: 0.41,
833
+ cooling_ratio: 0.33,
834
+ tanekojis: [
835
+ Tanekoji.new(
836
+ brand: :byakuya,
837
+ ratio: 0.001,
838
+ ),
839
+ ],
840
+ dekoji_ratio: 0.18,
841
+ interval_days: 0,
842
+ ),
843
+ ],
844
+ kakes: [
845
+ Kake.new(
846
+ weight: 300,
847
+ brand: :yamadanishiki,
848
+ polishing_ratio: 0.55,
849
+ made_in: :hyogo,
850
+ year: 2020,
851
+ soaking_ratio: 0.33,
852
+ steaming_ratio: 0.41,
853
+ cooling_ratio: 0.33,
854
+ interval_days: 9,
855
+ ),
856
+ ],
857
+ waters: [
858
+ Water.new(
859
+ weight: 400,
860
+ ),
861
+ ],
213
862
  ),
214
- Step.create(
215
- name: :soe,
216
- kake: 130,
217
- koji: 0,
218
- water: 0,
219
- koji_interval_days: 0,
220
- kake_interval_days: 1,
863
+ Step.new(
864
+ index: 3,
865
+ subindex: 0,
866
+ kojis: [
867
+ Koji.new(
868
+ weight: 110,
869
+ brand: :yamadanishiki,
870
+ polishing_ratio: 0.55,
871
+ made_in: :hyogo,
872
+ year: 2020,
873
+ soaking_ratio: 0.33,
874
+ steaming_ratio: 0.41,
875
+ cooling_ratio: 0.33,
876
+ tanekojis: [
877
+ Tanekoji.new(
878
+ brand: :byakuya,
879
+ ratio: 0.001,
880
+ ),
881
+ ],
882
+ dekoji_ratio: 0.18,
883
+ interval_days: 0,
884
+ ),
885
+ ],
886
+ kakes: [
887
+ Kake.new(
888
+ weight: 490,
889
+ brand: :yamadanishiki,
890
+ polishing_ratio: 0.55,
891
+ made_in: :hyogo,
892
+ year: 2020,
893
+ soaking_ratio: 0.33,
894
+ steaming_ratio: 0.41,
895
+ cooling_ratio: 0.33,
896
+ interval_days: 10,
897
+ ),
898
+ ],
899
+ waters: [
900
+ Water.new(
901
+ weight: 800,
902
+ ),
903
+ ],
221
904
  ),
222
- Step.create(
223
- name: :naka,
224
- kake: 300,
225
- koji: 100,
226
- water: 400,
227
- koji_interval_days: 0,
228
- kake_interval_days: 2,
905
+ Step.new(
906
+ index: 4,
907
+ subindex: 0,
908
+ waters: [
909
+ Water.new(
910
+ weight: 255,
911
+ ),
912
+ ],
229
913
  ),
230
- Step.create(
231
- name: :tome,
232
- kake: 490,
233
- koji: 110,
234
- water: 800,
235
- koji_interval_days: 0,
236
- kake_interval_days: 1,
914
+ ].map(&:freeze).freeze,
915
+ actions: [
916
+ Action.new(
917
+ type: :squeeze,
918
+ interval_days: 50,
237
919
  ),
238
- Step.create(
239
- name: :yodan,
240
- water: 255
920
+ ].map(&:freeze).freeze,
921
+ ab_coef: 1.4,
922
+ ab_expects: [
923
+ AbExpect.new(
924
+ alcohol: 15.0,
925
+ nihonshudo: 0.0,
241
926
  ),
242
- ].map(&:freeze).freeze
927
+ AbExpect.new(
928
+ alcohol: 16.0,
929
+ nihonshudo: 3.0,
930
+ ),
931
+ ].map(&:freeze).freeze,
243
932
  ).freeze,
244
933
  }.freeze
245
934
  end
246
935
 
247
936
 
248
- class KojiEvent
249
- include Toji::Event::KojiEvent
937
+ class KojiSchedule
938
+ include Toji::Schedule::KojiSchedule
939
+
940
+ attr_reader :product
941
+ attr_reader :date
942
+
943
+ attr_reader :step_indexes
944
+ attr_reader :expect
250
945
 
251
- def initialize(product:, date:, group_index:, indexes:, raw:)
946
+ def initialize(product:, date:, step_indexes:, expect:)
252
947
  @product = product
253
948
  @date = date
254
- @group_index = group_index
255
- @indexes = indexes
256
- @raw = raw
949
+ @step_indexes = step_indexes
950
+ @expect = expect
257
951
  end
258
952
  end
259
953
 
954
+ class KakeSchedule
955
+ include Toji::Schedule::KakeSchedule
260
956
 
261
- class KakeEvent
262
- include Toji::Event::KakeEvent
957
+ attr_reader :product
958
+ attr_reader :date
263
959
 
264
- def initialize(product:, date:, group_index:, indexes:, raw:)
960
+ attr_reader :step_indexes
961
+ attr_reader :expect
962
+
963
+ def initialize(product:, date:, step_indexes:, expect:)
265
964
  @product = product
266
965
  @date = date
267
- @group_index = group_index
268
- @indexes = indexes
269
- @raw = raw
966
+ @step_indexes = step_indexes
967
+ @expect = expect
270
968
  end
271
969
  end
272
970
 
971
+ class ActionSchedule
972
+ include Toji::Schedule::ActionSchedule
973
+
974
+ attr_reader :product
975
+ attr_reader :date
976
+ attr_reader :type
273
977
 
274
- class ActionEvent
275
- include Toji::Event::ActionEvent
978
+ attr_reader :index_index
276
979
 
277
- def initialize(product:, date:, type:, index:)
980
+ def initialize(product:, date:, type:, action_index:)
278
981
  @product = product
279
982
  @date = date
280
983
  @type = type
281
- @index = index
984
+ @action_index = action_index
282
985
  end
283
986
  end
284
987
 
285
988
 
286
- class Product
287
- include Toji::Product
288
- include Toji::Product::EventFactory
989
+ module Progress
990
+ module ProgressGenerator
991
+ def load_hash(hash)
992
+ hash = hash.deep_symbolize_keys
289
993
 
290
- attr_accessor :description
291
- attr_accessor :color
994
+ builder
995
+ .add(hash[:states] || [])
996
+ .date_line(hash[:date_line] || 0, Toji::Progress::HOUR)
997
+ .prefix_day_labels(hash[:prefix_day_labels])
998
+ .build
999
+ end
292
1000
 
293
- def initialize(id, name, description, recipe, base_date, color=nil)
294
- @id = id
295
- @name = name
296
- @description = description
297
- @recipe = recipe
298
- @base_date = base_date
299
- @color = color
1001
+ def load_yaml_file(fname)
1002
+ hash = YAML.load_file(fname)
1003
+ load_hash(hash)
1004
+ end
300
1005
  end
301
1006
 
302
- def create_koji_event(date:, group_index:, indexes:, raw:)
303
- KojiEvent.new(product: self, date: date, group_index: group_index, indexes: indexes, raw: raw)
1007
+ class KojiProgress
1008
+ include Toji::Progress::KojiProgress
1009
+ extend ProgressGenerator
1010
+
1011
+ attr_accessor :states
1012
+ attr_accessor :date_line
1013
+
1014
+ def self.builder
1015
+ Toji::Progress::Builder.new(KojiProgress, KojiState)
1016
+ end
304
1017
  end
305
1018
 
306
- def create_kake_event(date:, group_index:, indexes:, raw:)
307
- KakeEvent.new(product: self, date: date, group_index: group_index, indexes: indexes, raw: raw)
1019
+ class KojiState
1020
+ include Toji::Progress::KojiState
1021
+
1022
+ attr_accessor :progress
1023
+ attr_accessor :time
1024
+ attr_accessor :mark
1025
+
1026
+ attr_accessor :temps
1027
+ attr_accessor :preset_temp
1028
+ attr_accessor :room_temp
1029
+ attr_accessor :room_psychrometry
1030
+ attr_accessor :note
1031
+
1032
+ def self.create(args)
1033
+ new.tap {|s|
1034
+ s.progress = args[:progress]
1035
+ s.time = args[:time].to_time
1036
+ s.mark = args[:mark]
1037
+ s.temps = [args[:temps]].flatten.compact
1038
+ s.preset_temp = args[:preset_temp]
1039
+ s.room_temp = args[:room_temp]
1040
+ s.room_psychrometry = args[:room_psychrometry]
1041
+ s.note = args[:note]
1042
+ }
1043
+ end
308
1044
  end
309
1045
 
310
- def create_action_event(date:, type:, index:)
311
- ActionEvent.new(product: self, date: date, type: type, index: index)
1046
+ class MotoProgress
1047
+ include Toji::Progress::MotoProgress
1048
+ extend ProgressGenerator
1049
+
1050
+ attr_accessor :states
1051
+ attr_accessor :date_line
1052
+
1053
+ def self.builder
1054
+ Toji::Progress::Builder.new(MotoProgress, MotoState)
1055
+ end
312
1056
  end
313
1057
 
314
- def self.create(args)
315
- if self===args
316
- args
317
- elsif Hash===args
318
- recipe = args.fetch(:recipe)
319
- if Symbol===recipe
320
- recipe = Recipe::TEMPLATES.fetch(recipe)
321
- end
322
- if args[:scale]
323
- recipe = recipe.scale(args[:scale])
324
- end
325
- if args[:round]
326
- recipe = recipe.round(args[:round])
327
- end
1058
+ class MotoState
1059
+ include Toji::Progress::MotoState
328
1060
 
329
- new(
330
- args[:id],
331
- args[:name],
332
- args[:description],
333
- recipe,
334
- args[:base_date],
335
- args[:color]
336
- )
337
- else
338
- raise "not supported class: #{args.class}"
1061
+ attr_accessor :progress
1062
+ attr_accessor :time
1063
+ attr_accessor :mark
1064
+
1065
+ attr_accessor :temps
1066
+ attr_accessor :preset_temp
1067
+ attr_accessor :room_temp
1068
+ attr_accessor :room_psychrometry
1069
+ attr_accessor :baume
1070
+ attr_accessor :acid
1071
+ attr_accessor :warmings
1072
+ attr_accessor :note
1073
+
1074
+ def self.create(args)
1075
+ new.tap {|s|
1076
+ s.progress = args[:progress]
1077
+ s.time = args[:time].to_time
1078
+ s.mark = args[:mark]
1079
+ s.temps = [args[:temps]].flatten.compact
1080
+ s.preset_temp = args[:preset_temp]
1081
+ s.room_temp = args[:room_temp]
1082
+ s.room_psychrometry = args[:room_psychrometry]
1083
+ s.baume = args[:baume]
1084
+ s.acid = args[:acid]
1085
+ s.warmings = [args[:warmings]].flatten.compact
1086
+ s.note = args[:note]
1087
+ }
1088
+ end
1089
+ end
1090
+
1091
+
1092
+ class MoromiProgress
1093
+ include Toji::Progress::MoromiProgress
1094
+ extend ProgressGenerator
1095
+
1096
+ attr_accessor :states
1097
+ attr_accessor :date_line
1098
+ attr_accessor :prefix_day_labels
1099
+
1100
+ def self.builder
1101
+ Toji::Progress::Builder.new(MoromiProgress, MoromiState)
1102
+ end
1103
+ end
1104
+
1105
+ class MoromiState
1106
+ include Toji::Progress::MoromiState
1107
+ include Toji::Progress::State::BaumeToNihonshudo
1108
+
1109
+ attr_accessor :progress
1110
+ attr_accessor :time
1111
+ attr_accessor :mark
1112
+
1113
+ attr_accessor :temps
1114
+ attr_accessor :preset_temp
1115
+ attr_accessor :room_temp
1116
+ attr_accessor :room_psychrometry
1117
+ attr_accessor :baume
1118
+ attr_accessor :acid
1119
+ attr_accessor :amino_acid
1120
+ attr_accessor :alcohol
1121
+ attr_accessor :warmings
1122
+ attr_accessor :note
1123
+
1124
+ def self.create(args)
1125
+ new.tap {|s|
1126
+ s.progress = args[:progress]
1127
+ s.time = args[:time].to_time
1128
+ s.mark = args[:mark]
1129
+ s.temps = [args[:temps]].flatten.compact
1130
+ s.preset_temp = args[:preset_temp]
1131
+ s.room_temp = args[:room_temp]
1132
+ s.room_psychrometry = args[:room_psychrometry]
1133
+ if args[:baume]
1134
+ s.baume = args[:baume]
1135
+ else
1136
+ s.nihonshudo = args[:nihonshudo]
1137
+ end
1138
+ s.acid = args[:acid]
1139
+ s.amino_acid = args[:amino_acid]
1140
+ s.alcohol = args[:alcohol]
1141
+ s.warmings = [args[:warmings]].flatten.compact
1142
+ s.note = args[:note]
1143
+ }
339
1144
  end
340
1145
  end
341
1146
  end