Class: ProMashRec::Style

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

Constant Summary collapse

@@style_guides =
{ 0 => "AHA", 1 => "BJCP" }
@@style_types =
{ 0 => "Ale", 1 => "Lager", 2 => "Cider", 3 => "Mead", 5 => "Hybrid"}

Instance Method Summary collapse

Methods inherited from Brewser::Style

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



388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
# File 'lib/brewser/engines/promash_rec.rb', line 388

def from_promash(style)
  self.name = style.sub_category.split("\x00")[0]
  self.category = style.category.split("\x00")[0]
  self.category_number = style.category_number
  self.style_letter = style.sub_category_letter
  self.style_guide = @@style_guides[style._guideline]
  self.type = @@style_types[style._type]
  self.og_min = style.min_og
  self.og_max = style.max_og
  self.fg_min = style.min_fg
  self.fg_max = style.max_fg
  self.ibu_min = style.min_ibu
  self.ibu_max = style.max_ibu
  self.color_min = style.min_color
  self.color_max = style.max_color
  self.examples = style.examples
  
  return self
end