Module: Yeast

Defined in:
lib/yeast.rb

Overview

Various yeast related calculations

Class Method Summary collapse

Class Method Details

.attenuation(original, current) ⇒ Fixnum

Note:

Extract must be measured in Plato

Calculates apparent attenuation

Examples:

Yeast.attenuation 13.5, 3.1

Parameters:

  • original (Float)

    original Plato

  • current (Float)

    current Plato

Returns:

  • (Fixnum)

    apparent attenuation


46
47
48
# File 'lib/yeast.rb', line 46

def self.attenuation original, current
  (((original - current) / original) * 100).round
end

.cells_required(data) ⇒ Fixnum

Note:

Extract must be measured in Plato, volume in liters

Calculates yeast cells required for fermentation

Examples:

Yeast.cells_required({
  extract: 15,
  volume: 20
})

Yeast.cells_required({
  extract: 15,
  volume: 20,
  type: lager
})

Parameters:

  • data (Hash)

    data required to calculate yeast cells required; extract, volume and optionally type. type defaults to :ale but may also be :hybrid or :lager

Returns:

  • (Fixnum)

    yeast cells required


23
24
25
26
27
28
29
30
31
32
33
# File 'lib/yeast.rb', line 23

def self.cells_required data
  type = data[:type] || :ale

  cells_per_milliliter = case type
  when :ale     then 750_000
  when :hybrid  then 1_125_000
  when :lager   then 1_500_000
  end

  (cells_per_milliliter * (data[:volume] * 1000) * data[:extract]).round
end