Class: ProMashRec::Style
- Inherits:
-
Brewser::Style
- Object
- Brewser::Model
- Brewser::Style
- ProMashRec::Style
- 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::Model
#as_beerxml, #as_brewson, auto_migrate_down!, auto_migrate_up!, auto_upgrade!, #deep_json, default_repository_name, #to_json
Instance Method Details
#from_promash(style) ⇒ Object
364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 |
# File 'lib/brewser/engines/promash_rec.rb', line 364 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 |