Class: ProMashRec::Additive

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

Constant Summary collapse

@@additive_types =
{ 0 => "Spice", 1 => "Fruit", 2 => "Flavor", 3 => "Other", 4 => "Fining", 5 => "Herb" }
@@added_whens =
{ 0 => "Boil", 1 => "Primary", 2 => "Mash" }
@@additive_unit =
{ 0 => "oz", 1 => "g", 2 => "lb", 3 => "tsp", 4 => "tbsp", 5 => "cups", 6 => "each" }
@@additive_time =
{ 0 => "days", 1 => "min" }

Instance Method Summary collapse

Methods inherited from Brewser::Additive

#as_json, json_create

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



273
274
275
276
277
278
279
280
281
282
# File 'lib/brewser/engines/promash_rec.rb', line 273

def from_promash(add)
  self.name = add.name.split("\x00")[0]
  self.type = @@additive_types[add.type]
  self.added_when = @@added_whens[add.added_when]
  self.time = "#{add.time} #{@@additive_time[add.time_in]}".u
  self.amount = "#{add.amount} #{@@additive_unit[add.amount_unit]}".u
  self.use_for = add.uses
  
  return self
end