toji 1.6.7 → 1.6.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/toji/schedule/product.rb +21 -0
- data/lib/toji/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8cb7b9d1041efe57106054ed9e49f2d521550ab9f81a3de9be8433ff7f672926
|
4
|
+
data.tar.gz: 77297b7cba2845e1e470e37ddbb70db62cd71c8fc0afd5505e152249fe98d029
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5f87b0a0fb8d9ca5bc066c8790cee02d0f12bb12fd10b9ca2ca57f87b8749e2c4650a718ce244caccbd297b0f3ea4b81436db17ab83454032e6149afa7548f5
|
7
|
+
data.tar.gz: f877c7e824aa82285bcc93de1e7b9c88bef392c505fb6ab49ba4435b38329946298420ead7a207fdfb938fa4d7a9d438ec852d52f202895208997b039eed4520
|
@@ -44,6 +44,26 @@ module Toji
|
|
44
44
|
events
|
45
45
|
end
|
46
46
|
|
47
|
+
def events_group
|
48
|
+
events.group_by{|event|
|
49
|
+
event.group_key
|
50
|
+
}.map {|group_key,events|
|
51
|
+
breakdown = events.map {|event|
|
52
|
+
{index: event.index, weight: event.weight}
|
53
|
+
}
|
54
|
+
if 1<breakdown.length
|
55
|
+
breakdown = breakdown.select{|event| 0<event[:weight]}
|
56
|
+
end
|
57
|
+
|
58
|
+
{
|
59
|
+
date: events.first.date,
|
60
|
+
type: events.first.type,
|
61
|
+
weight: events.map(&:weight).sum,
|
62
|
+
breakdown: breakdown,
|
63
|
+
}
|
64
|
+
}
|
65
|
+
end
|
66
|
+
|
47
67
|
def to_h
|
48
68
|
{
|
49
69
|
id: @id,
|
@@ -53,6 +73,7 @@ module Toji
|
|
53
73
|
koji_dates: @koji_dates,
|
54
74
|
rice_dates: @rice_dates,
|
55
75
|
events: events.map(&:to_h),
|
76
|
+
events_group: events_group,
|
56
77
|
color: @color,
|
57
78
|
}
|
58
79
|
end
|
data/lib/toji/version.rb
CHANGED
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: 1.6.
|
4
|
+
version: 1.6.8
|
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-05-
|
11
|
+
date: 2020-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -194,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
194
194
|
- !ruby/object:Gem::Version
|
195
195
|
version: '0'
|
196
196
|
requirements: []
|
197
|
-
rubygems_version: 3.
|
197
|
+
rubygems_version: 3.0.3
|
198
198
|
signing_key:
|
199
199
|
specification_version: 4
|
200
200
|
summary: Management tools for brewing japanese sake.
|