Class: ProMashRec::Fermentable

Inherits:
Brewser::Fermentable show all
Defined in:
lib/brewser/engines/promash_rec.rb

Constant Summary collapse

@@ferm_types =
{0 => { 0 => "Grain", 1 => "Dry Extract", 2 => "Sugar", 3 => "Adjunct"},
1 => { 0 => "Grain", 1 => "Extract", 2 => "Sugar", 3 => "Adjunct"}}

Instance Method Summary collapse

Methods inherited from Brewser::Fermentable

#as_json, json_create, #ppg

Methods inherited from Brewser::Model

#as_beerxml, #as_brewson, auto_migrate_down!, auto_migrate_up!, auto_upgrade!, default_repository_name

Instance Method Details

#from_promash(ferm) ⇒ Object



250
251
252
253
254
255
256
257
258
259
260
261
262
# File 'lib/brewser/engines/promash_rec.rb', line 250

def from_promash(ferm)
  self.name = ferm.name.split("\x00")[0]
  self.origin = ferm.origin.split("\x00")[0]
  self.type = @@ferm_types[ferm.form][ferm.type]
  self.potential = ferm.potential.round(3)
  self.color = ferm.color
  self.amount = "#{ferm.amount} lbs".u
  self.diastatic_power = ferm.diastatic_power
  self.max_in_batch = ferm.max_in_batch
  self.moisture = ferm.moisture_content
  
  return self
end