toji 1.5.0 → 1.6.0

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: babdb8cea1bd57660a6e5eb2652b1f6a99e45f8a10e4249ce7406db9195255da
4
- data.tar.gz: 488d9490343ff3828b974c3cff9ec5784cd4cc7fb618e47420a2f1099eae47b2
3
+ metadata.gz: da8a1b74fff1ead3a469ab8609d313b86641348b0ced33d88ea3210d53346c55
4
+ data.tar.gz: 0fde77cdbc4df03c63ef13d3a2792c790b7c3dfcd200f19f6a3a0d156411e196
5
5
  SHA512:
6
- metadata.gz: 8fd8b2552331a81cb0c584b39a5f8f816f155e6d09d6bc28de30d55144631f6e451abbd4ecc49ba2a880a94e4db120106532f74dda7a8ae99e36ec1cc1e0935b
7
- data.tar.gz: 85dab7b8fdf06c7a8fe31ac0b5c2643a5702530e37d477ebe56fd414c3329fd4141c2828151cecc166d76ae64c6cf8a1d3eaf817c2eaf7b6d5e4c6010757654e
6
+ metadata.gz: b623b8508553a10c40a5c38dc5247a257d26057a5f38c2ce56cc2ac16a670f6fa2937ac43265cb0a7f1bfe5860d789c3ea7ccbc7541e2c559d773d8c8410987f
7
+ data.tar.gz: 3cd36627d7d0c4f2bd765b0c3eb57efacb1842b447a7b767de6db6e7da0d7e99f9b9871bec6cb140db2fce1f04e0a92ac45912f5bf734a70eeff9f30018db912
@@ -106,6 +106,16 @@ module Toji
106
106
  }
107
107
  end
108
108
 
109
+ def to_h
110
+ {
111
+ states: map(&:to_h),
112
+ has_keys: has_keys,
113
+ day_offset: day_offset,
114
+ days: days,
115
+ day_labels: day_labels,
116
+ }
117
+ end
118
+
109
119
  def self.create(records, date_line: 0)
110
120
  if Base===records
111
121
  records
@@ -40,16 +40,12 @@ module Toji
40
40
  alias_method :add, :<<
41
41
 
42
42
  def plot_data(keys=nil)
43
- use_name = 2<=@progresses.length
44
-
45
43
  @progresses.map {|progress|
46
- progress.plot_data(keys, use_name)
44
+ progress.plot_data(keys, true)
47
45
  }.inject([], :+)
48
46
  end
49
47
 
50
48
  def annotations
51
- use_name = 2<=@progresses.length
52
-
53
49
  @progresses.map {|progress|
54
50
  progress.annotations
55
51
  }.inject([], :+)
@@ -44,7 +44,7 @@ module Toji
44
44
  end
45
45
 
46
46
  name = ""
47
- if @name
47
+ if use_name && @name
48
48
  name = "#{@name} "
49
49
  end
50
50
 
@@ -103,6 +103,32 @@ module Toji
103
103
  target_alc - (_baume - target_nihonshudo * -0.1) * coef
104
104
  end
105
105
  end
106
+
107
+ def to_h
108
+ {
109
+ elapsed_time: elapsed_time,
110
+ time: time,
111
+ mark: mark,
112
+ temps: temps,
113
+ preset_temp: preset_temp,
114
+ room_temp: room_temp,
115
+ room_psychrometry: room_psychrometry,
116
+ acid: acid,
117
+ amino_acid: amino_acid,
118
+ alcohol: alcohol,
119
+ warmings: warmings,
120
+ note: note,
121
+
122
+ day: day,
123
+ day_label: day_label,
124
+ elapsed_time_with_offset: elapsed_time_with_offset,
125
+ baume: baume,
126
+ nihonshudo: nihonshudo,
127
+ display_baume: display_baume,
128
+ moromi_day: moromi_day,
129
+ bmd: bmd,
130
+ }
131
+ end
106
132
  end
107
133
  end
108
134
  end
@@ -25,6 +25,15 @@ module Toji
25
25
  "#{name}: #{weight}"
26
26
  }.join("<br>")
27
27
  end
28
+
29
+ def to_h_a
30
+ event_groups.map {|es|
31
+ {
32
+ product: es.first.product.to_h,
33
+ weight: es.map(&:weight).sum,
34
+ }
35
+ }
36
+ end
28
37
  end
29
38
  end
30
39
  end
data/lib/toji/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Toji
2
- VERSION = "1.5.0"
2
+ VERSION = "1.6.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: 1.5.0
4
+ version: 1.6.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-05-01 00:00:00.000000000 Z
11
+ date: 2020-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport