toji 1.6.5 → 1.6.6

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: b1a2b7e3b28049c6bcea4e592b05b34e30d6401f000a2c34131587bdb618cebc
4
- data.tar.gz: 9b2ea8360654519981cb1e892107b4210f04b4fd01a41bbd9e9635c102456401
3
+ metadata.gz: 5a988802371162370669a50350ab7878a88e76366f2d9f32401dcb3a06fadf4e
4
+ data.tar.gz: b8300b0795e0eee8055765301a165a191fd334736ec0d19f76278dc4cb1262b4
5
5
  SHA512:
6
- metadata.gz: 44ba2b32fa2d77088a3161730b5621e770f7ce800d2a241fa5cbecf107189f0e6b047d99723f8a442c91276ef4cbefd68ba7621f94b2efe686cbaba22cffcadb
7
- data.tar.gz: 90a4964b60455e1be915052aa54656459651c2f8b3868097c2ac279fd9b19495f3c31b399d334f385800482b6a38a1cd8780e2bbe703a82d3374a325d166289d
6
+ metadata.gz: 312348c96281f8576e078446c76044855d45c02ad7165691d817c0958f83539e9c8d03f0bf2d1a7eb882e890e0e575ae041370e0c8ce594546bc308016b18640
7
+ data.tar.gz: 85a29ffef5ef2055102890a74509e38ffd090a5ea5336adeb3710c74f69ad4ffaeaa8271f7c88b194239d279087d72ad52b321bccbeac9ca6366ddf71bee4004
@@ -97,6 +97,17 @@ module Toji
97
97
  x * y
98
98
  end
99
99
  end
100
+
101
+ def to_h
102
+ {
103
+ name: name,
104
+ rice: rice.raw,
105
+ koji: koji.raw,
106
+ water: water,
107
+ lactic_acid: lactic_acid,
108
+ alcohol: alcohol,
109
+ }
110
+ end
100
111
  end
101
112
  end
102
113
  end
@@ -70,7 +70,7 @@ module Toji
70
70
  #
71
71
  # 出典: 酒造教本 P96
72
72
  def shubo_rate
73
- cumulative_shubo_rates.last
73
+ cumulative_shubo_rates.last || 0.0
74
74
  end
75
75
 
76
76
  # 白米比率
@@ -87,6 +87,16 @@ module Toji
87
87
  }
88
88
  end
89
89
 
90
+ def to_h
91
+ {
92
+ steps: steps.map(&:to_h),
93
+ cumulative_rice_totals: cumulative_rice_totals,
94
+ cumulative_shubo_rates: cumulative_shubo_rates,
95
+ shubo_rate: shubo_rate,
96
+ rice_rates: rice_rates,
97
+ }
98
+ end
99
+
90
100
  def table_data
91
101
  headers = [""] + @steps.map(&:name) + [:total]
92
102
  keys = [:rice_total, :rice, :koji, :alcohol, :water, :lactic_acid]
@@ -44,6 +44,16 @@ module Toji
44
44
  events
45
45
  end
46
46
 
47
+ def to_h
48
+ {
49
+ id: @id,
50
+ name: @name,
51
+ description: @description,
52
+ recipe: @recipe.table_data,
53
+ color: @color,
54
+ }
55
+ end
56
+
47
57
  def self.create(args)
48
58
  if self===args
49
59
  args
data/lib/toji/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Toji
2
- VERSION = "1.6.5"
2
+ VERSION = "1.6.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toji
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.5
4
+ version: 1.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoshida Tetsuya