Module: Zymurgy::Utils

Defined in:
lib/zymurgy/utils.rb

Instance Method Summary collapse

Instance Method Details

#celsius_2_fahrenheit(degrees_celsius) ⇒ Object



28
29
30
# File 'lib/zymurgy/utils.rb', line 28

def celsius_2_fahrenheit degrees_celsius
  32.0 + degrees_celsius / (5.0/9.0)
end

#fahrenheit_2_celsius(degrees_fahrenheit) ⇒ Object



32
33
34
# File 'lib/zymurgy/utils.rb', line 32

def fahrenheit_2_celsius degrees_fahrenheit
  (5.0/9.0) * (degrees_fahrenheit - 32.0)
end

#kilograms_2_ounces(kilograms) ⇒ Object



20
21
22
# File 'lib/zymurgy/utils.rb', line 20

def kilograms_2_ounces kilograms
  kilograms / 0.0283495231
end

#kilograms_2_pounds(kilograms) ⇒ Object



12
13
14
# File 'lib/zymurgy/utils.rb', line 12

def kilograms_2_pounds kilograms
  kilograms * 2.2
end

#litres_2_us_gallons(litres) ⇒ Object



4
5
6
# File 'lib/zymurgy/utils.rb', line 4

def litres_2_us_gallons litres
  litres / 3.78541178
end

#ounces_2_kilograms(ounces) ⇒ Object



24
25
26
# File 'lib/zymurgy/utils.rb', line 24

def ounces_2_kilograms ounces
  ounces * 0.0283495231
end

#pkgl_2_ppg(pkgl) ⇒ Object



36
37
38
# File 'lib/zymurgy/utils.rb', line 36

def pkgl_2_ppg pkgl
  litres_2_us_gallons(pounds_2_kilograms(pkgl))
end

#pounds_2_kilograms(pounds) ⇒ Object



16
17
18
# File 'lib/zymurgy/utils.rb', line 16

def pounds_2_kilograms pounds
  pounds / 2.2
end

#ppg_2_pkgl(ppg) ⇒ Object



40
41
42
# File 'lib/zymurgy/utils.rb', line 40

def ppg_2_pkgl ppg
  us_gallons_2_litres(kilograms_2_pounds(ppg))
end

#us_gallons_2_litres(gallons) ⇒ Object



8
9
10
# File 'lib/zymurgy/utils.rb', line 8

def us_gallons_2_litres gallons
  gallons * 3.78541178
end