Class: ProMashTxt::Fermentable

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

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(string) ⇒ Object



52
53
54
55
56
57
58
59
60
# File 'lib/brewser/engines/promash_txt.rb', line 52

def from_promash(string)
  # String should look like this:
  #  12.5     1.50 lbs. Victory Malt                  America        1.034     25
  self.amount = string[8..17].strip.u
  self.name = string[20..48].strip
  self.potential = string[65..70].strip
  self.color = string[74..77].strip.to_f
  return self
end