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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e794a27e9bb5b5d342fe42b1e81c489417c8bcc4011fadaf541b7ed87634e2b0
4
- data.tar.gz: 477371e1a2dc89d0d48416078a7b90da89010b7850bf544bc22c02d5d455aea6
3
+ metadata.gz: 8cb7b9d1041efe57106054ed9e49f2d521550ab9f81a3de9be8433ff7f672926
4
+ data.tar.gz: 77297b7cba2845e1e470e37ddbb70db62cd71c8fc0afd5505e152249fe98d029
5
5
  SHA512:
6
- metadata.gz: 48cb8b530918ea6de1aa9ca32de2a47276390e7d69777f1eb68758df2ff15ea1a1ddde11d29c69b93a29bf4ce735c80bb59c70344c2ab8923e8266c5f287d38c
7
- data.tar.gz: 1d04e4faef757aee2518981f5518062693ebe2c140b64f69577faf143dcfb12b2c113e1fc40e406af1d7b79bb588489c09ef1b0d9e17ce1310ac3ea0e0d1f577
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
@@ -1,3 +1,3 @@
1
1
  module Toji
2
- VERSION = "1.6.7"
2
+ VERSION = "1.6.8"
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: 1.6.7
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-09 00:00:00.000000000 Z
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.1.2
197
+ rubygems_version: 3.0.3
198
198
  signing_key:
199
199
  specification_version: 4
200
200
  summary: Management tools for brewing japanese sake.