toji 2.13.1 → 2.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3518ae786928b8b08256616f1b86f9f00b51fe7a41150a628b195aa3b8e43e2f
4
- data.tar.gz: b6c34cfccdfb72cad06e8206b29cbf7d451b62f060084aaeb92e4c4d6ea81792
3
+ metadata.gz: 37499051191a04bbfe3557557db95602364782e93cabca5a8c66df22b0f23a2a
4
+ data.tar.gz: eb22b32536b32ed7d8441ad6586cc7b1d46fe617931272f88930d2b4df511728
5
5
  SHA512:
6
- metadata.gz: ae0f6e5cc017e3f60df94d680c6cea7f4b1a529ab7c99ebd731dc9de409406f5a9b5d7974525a110c67c447dcfccb474ca388849154825fd17c4b7d7cc03637b
7
- data.tar.gz: ae9a15847daf96541a4c081c121befc603dd9df0e7b5ae268915ddeb52442370a99cc8208cf607d1e998cc4e9e93f78dc8a9d2b9351f601a03806fad4038672b
6
+ metadata.gz: dd61d83746fa569a42d10cd46450ae7b9b30264f275c87d3795d8749f93814c18105d49e88d5683daa76bf627d89068645c89d7432e8a2dfb3bfe4af3cb7dc62
7
+ data.tar.gz: 6563f31a5eed5ec04150b75d5248e0c3b936b1cfdfb0b68f89732b032980f67a1518663c450a7bef3c44468ee5a6069cf4a4b0de8ca92633d5053fe28da690bc
@@ -86,7 +86,8 @@ module Example
86
86
  class Step
87
87
  include Toji::Recipe::Step
88
88
 
89
- def initialize(kojis: [], kakes: [], waters: [], lactic_acids: [], alcohols: [], yeasts: [])
89
+ def initialize(index:, kojis: [], kakes: [], waters: [], lactic_acids: [], alcohols: [], yeasts: [])
90
+ @index = index
90
91
  @kojis = kojis
91
92
  @kakes = kakes
92
93
  @waters = waters
@@ -244,6 +245,7 @@ module Example
244
245
  sokujo_textbook: new(
245
246
  [
246
247
  Step.new(
248
+ index: 0,
247
249
  kojis: [
248
250
  Koji.new(
249
251
  weight: 20,
@@ -294,6 +296,7 @@ module Example
294
296
  ]
295
297
  ),
296
298
  Step.new(
299
+ index: 1,
297
300
  kojis: [
298
301
  Koji.new(
299
302
  weight: 40,
@@ -334,6 +337,7 @@ module Example
334
337
  ],
335
338
  ),
336
339
  Step.new(
340
+ index: 2,
337
341
  kojis: [
338
342
  Koji.new(
339
343
  weight: 60,
@@ -374,6 +378,7 @@ module Example
374
378
  ],
375
379
  ),
376
380
  Step.new(
381
+ index: 3,
377
382
  kojis: [
378
383
  Koji.new(
379
384
  weight: 80,
@@ -414,6 +419,7 @@ module Example
414
419
  ],
415
420
  ),
416
421
  Step.new(
422
+ index: 4,
417
423
  kakes: [
418
424
  Kake.new(
419
425
  weight: 80,
@@ -440,6 +446,7 @@ module Example
440
446
  sokujo_nada: new(
441
447
  [
442
448
  Step.new(
449
+ index: 0,
443
450
  kojis: [
444
451
  Koji.new(
445
452
  weight: 47,
@@ -490,6 +497,7 @@ module Example
490
497
  ],
491
498
  ),
492
499
  Step.new(
500
+ index: 1,
493
501
  kojis: [
494
502
  Koji.new(
495
503
  weight: 99,
@@ -530,6 +538,7 @@ module Example
530
538
  ],
531
539
  ),
532
540
  Step.new(
541
+ index: 2,
533
542
  kojis: [
534
543
  Koji.new(
535
544
  weight: 143,
@@ -570,6 +579,7 @@ module Example
570
579
  ],
571
580
  ),
572
581
  Step.new(
582
+ index: 3,
573
583
  kojis: [
574
584
  Koji.new(
575
585
  weight: 165,
@@ -610,6 +620,7 @@ module Example
610
620
  ],
611
621
  ),
612
622
  Step.new(
623
+ index: 4,
613
624
  alcohols: [
614
625
  Alcohol.new(
615
626
  weight: 900,
@@ -623,6 +634,7 @@ module Example
623
634
  simple_sokujo_himeno: new(
624
635
  [
625
636
  Step.new(
637
+ index: 0,
626
638
  kojis: [
627
639
  Koji.new(
628
640
  weight: 70,
@@ -673,6 +685,7 @@ module Example
673
685
  ],
674
686
  ),
675
687
  Step.new(
688
+ index: 1,
676
689
  kojis: [
677
690
  Koji.new(
678
691
  weight: 0,
@@ -713,6 +726,7 @@ module Example
713
726
  ],
714
727
  ),
715
728
  Step.new(
729
+ index: 1,
716
730
  kojis: [
717
731
  Koji.new(
718
732
  weight: 100,
@@ -753,6 +767,7 @@ module Example
753
767
  ],
754
768
  ),
755
769
  Step.new(
770
+ index: 2,
756
771
  kojis: [
757
772
  Koji.new(
758
773
  weight: 110,
@@ -793,6 +808,7 @@ module Example
793
808
  ],
794
809
  ),
795
810
  Step.new(
811
+ index: 3,
796
812
  waters: [
797
813
  Water.new(
798
814
  weight: 255,
@@ -15,10 +15,10 @@ module Toji
15
15
  end
16
16
 
17
17
  def koji_schedules
18
- recipe.steps.each.with_index.inject([]) {|result, (step, i)|
18
+ recipe.steps.inject([]) {|result, step|
19
19
  step.kojis&.each {|koji|
20
20
  result << {
21
- step_index: i,
21
+ step_index: step.index,
22
22
  date: base_date.next_day(koji.interval_days),
23
23
  koji: koji,
24
24
  }
@@ -38,10 +38,10 @@ module Toji
38
38
  end
39
39
 
40
40
  def kake_schedules
41
- recipe.steps.each.with_index.inject([]) {|result, (step, i)|
41
+ recipe.steps.inject([]) {|result, step|
42
42
  step.kakes&.each {|kake|
43
43
  result << {
44
- step_index: i,
44
+ step_index: step.index,
45
45
  date: base_date.next_day(kake.interval_days),
46
46
  kake: kake,
47
47
  }
@@ -1,6 +1,7 @@
1
1
  module Toji
2
2
  module Recipe
3
3
  module Step
4
+ attr_reader :index
4
5
  attr_accessor :kojis
5
6
  attr_accessor :kakes
6
7
  attr_accessor :waters
@@ -1,3 +1,3 @@
1
1
  module Toji
2
- VERSION = "2.13.1"
2
+ VERSION = "2.14.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toji
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.13.1
4
+ version: 2.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoshida Tetsuya
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-03 00:00:00.000000000 Z
11
+ date: 2020-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport