beer_recipe 0.4.15 → 0.4.16
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 +4 -4
- data/lib/beer_recipe/formula.rb +10 -1
- data/lib/beer_recipe/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b71236b39d6959ee06a0c70878d36d2e2cfd2c62
|
4
|
+
data.tar.gz: 3a31d59a4ce551a119b05d037cc99d8c3fc4a58c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c1871a69e79ad5c2acc473e54cf24c53b8d96d842a542e6d70c831b836e6a590934f7cf58221ad9bbf90e6d6c5b44a04989bce2ceda48638fe87c34f9a2beeb
|
7
|
+
data.tar.gz: a7723d13437ae71c8ad1b4ac1db5941ed75673acf0fc35e4cb284bce604722a1d9b74e1a277ccda45c47a5768c8cfb3d75605ad5488acf7ea7d2f97c639d3ae4
|
data/lib/beer_recipe/formula.rb
CHANGED
@@ -8,6 +8,15 @@ module BeerRecipe
|
|
8
8
|
srm * 1.97
|
9
9
|
end
|
10
10
|
|
11
|
+
def ebc_to_lovibond(ebc)
|
12
|
+
srm = ebc_to_srm(ebc)
|
13
|
+
srm_to_lovibond(srm)
|
14
|
+
end
|
15
|
+
|
16
|
+
def srm_to_lovibond(srm)
|
17
|
+
(srm + 0.76) / 1.3546
|
18
|
+
end
|
19
|
+
|
11
20
|
def mcu_to_srm(mcu)
|
12
21
|
# SRM color = 1.4922 * (MCU ** 0.6859)
|
13
22
|
srm = 1.4922 * (mcu ** 0.6859)
|
@@ -27,7 +36,7 @@ module BeerRecipe
|
|
27
36
|
|
28
37
|
def mcu(amount, srm, volume)
|
29
38
|
# MCU = (weight kg * lovibond * 2.205) / (volume * 0.264)
|
30
|
-
(amount * srm * 2.205) / (volume * 0.264)
|
39
|
+
(amount * srm_to_lovibond(srm) * 2.205) / (volume * 0.264)
|
31
40
|
end
|
32
41
|
|
33
42
|
def sg_to_abv(og, fg)
|
data/lib/beer_recipe/version.rb
CHANGED