beercalc 0.0.5 → 0.0.6
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.
- data/lib/beercalc.rb +11 -0
- metadata +2 -2
data/lib/beercalc.rb
CHANGED
@@ -182,4 +182,15 @@ class Beercalc
|
|
182
182
|
end
|
183
183
|
return addition
|
184
184
|
end
|
185
|
+
|
186
|
+
## GRAVITY TEMPERATURE CORRECTION
|
187
|
+
# param temp: number - Temperature in Fahrenheit
|
188
|
+
# param g: number - Gravity from the hydrometer reading
|
189
|
+
def self.gravityCorrection(temp, g)
|
190
|
+
unless !temp.is_a?(Numeric) || !g.is_a?(Numeric)
|
191
|
+
correction = ((1.313454 - 0.132674*temp + 2.057793*10**-3*temp**2 - 2.627634*10**-6*temp**3) * 0.001) + g
|
192
|
+
else
|
193
|
+
correction = nil
|
194
|
+
end
|
195
|
+
end
|
185
196
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beercalc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-11-
|
12
|
+
date: 2013-11-19 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Common beer calculations for brewers.
|
15
15
|
email: griffith.ben@gmail.com
|