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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f1ae600828106d280b4df7c60febe606aa6b1285
4
- data.tar.gz: eb6dea278d71ec24df914d8d76a85f130803f373
3
+ metadata.gz: b71236b39d6959ee06a0c70878d36d2e2cfd2c62
4
+ data.tar.gz: 3a31d59a4ce551a119b05d037cc99d8c3fc4a58c
5
5
  SHA512:
6
- metadata.gz: dfd575bfac349afe00fd80778ee1bf6d998930834f1eec0705a78f1c5cb266447bc1154b11235bccf4dff806dfc8aed846e120eb99a2ab75779021446d146a3f
7
- data.tar.gz: 7c1eb70a8e4440014b001132b91eb74f1bbbfe7a6092c02f9fb17df92b619e556da51a682429fdee2ac4a90586b9508ef4ec2cf1ae795cf162ded159f0504c8d
6
+ metadata.gz: 7c1871a69e79ad5c2acc473e54cf24c53b8d96d842a542e6d70c831b836e6a590934f7cf58221ad9bbf90e6d6c5b44a04989bce2ceda48638fe87c34f9a2beeb
7
+ data.tar.gz: a7723d13437ae71c8ad1b4ac1db5941ed75673acf0fc35e4cb284bce604722a1d9b74e1a277ccda45c47a5768c8cfb3d75605ad5488acf7ea7d2f97c639d3ae4
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module BeerRecipe
2
- VERSION = '0.4.15'
2
+ VERSION = '0.4.16'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beer_recipe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.15
4
+ version: 0.4.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olle Johansson