Class: Brewscribe::Style
- Inherits:
-
Object
- Object
- Brewscribe::Style
- Includes:
- Conversion
- Defined in:
- lib/brewscribe/style.rb
Constant Summary collapse
- TYPES =
['Ale', 'Lager', 'Mixed', 'Mead', 'Cider', 'Wheat']
- KEY_CONVERSION =
{ last_modified: DATE_CONV, min_og: FLOAT_CONV, max_og: FLOAT_CONV, min_fg: FLOAT_CONV, max_fg: FLOAT_CONV, number: INT_CONV, min_ibu: FLOAT_CONV, max_ibu: FLOAT_CONV, letter: ->(k) { Array('A'..'Z')[k.to_i-1] }, type: ->(k) { TYPES[k.to_i] }, min_abv: PERCENT_CONV, max_abv: PERCENT_CONV, min_color: FLOAT_CONV, max_color: FLOAT_CONV, examples: ->(k) { k.split(', ') } }
Constants included from Conversion
Conversion::BOOLEAN_CONV, Conversion::DATE_CONV, Conversion::FLOAT_CONV, Conversion::INT_CONV, Conversion::PERCENT_CONV
Instance Attribute Summary collapse
-
#category ⇒ Object
Returns the value of attribute category.
-
#description ⇒ Object
Returns the value of attribute description.
-
#examples ⇒ Object
Returns the value of attribute examples.
-
#guide ⇒ Object
Returns the value of attribute guide.
-
#ingredients ⇒ Object
Returns the value of attribute ingredients.
-
#last_modified ⇒ Object
Returns the value of attribute last_modified.
-
#letter ⇒ Object
Returns the value of attribute letter.
-
#max_abv ⇒ Object
Returns the value of attribute max_abv.
-
#max_carb ⇒ Object
Returns the value of attribute max_carb.
-
#max_color ⇒ Object
Returns the value of attribute max_color.
-
#max_fg ⇒ Object
Returns the value of attribute max_fg.
-
#max_ibu ⇒ Object
Returns the value of attribute max_ibu.
-
#max_og ⇒ Object
Returns the value of attribute max_og.
-
#min_abv ⇒ Object
Returns the value of attribute min_abv.
-
#min_carb ⇒ Object
Returns the value of attribute min_carb.
-
#min_color ⇒ Object
Returns the value of attribute min_color.
-
#min_fg ⇒ Object
Returns the value of attribute min_fg.
-
#min_ibu ⇒ Object
Returns the value of attribute min_ibu.
-
#min_og ⇒ Object
Returns the value of attribute min_og.
-
#name ⇒ Object
Returns the value of attribute name.
-
#number ⇒ Object
Returns the value of attribute number.
-
#profile ⇒ Object
Returns the value of attribute profile.
-
#type ⇒ Object
Returns the value of attribute type.
-
#web_link ⇒ Object
Returns the value of attribute web_link.
Class Method Summary collapse
Methods included from Conversion
Instance Attribute Details
#category ⇒ Object
Returns the value of attribute category.
3 4 5 |
# File 'lib/brewscribe/style.rb', line 3 def category @category end |
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/brewscribe/style.rb', line 3 def description @description end |
#examples ⇒ Object
Returns the value of attribute examples.
3 4 5 |
# File 'lib/brewscribe/style.rb', line 3 def examples @examples end |
#guide ⇒ Object
Returns the value of attribute guide.
3 4 5 |
# File 'lib/brewscribe/style.rb', line 3 def guide @guide end |
#ingredients ⇒ Object
Returns the value of attribute ingredients.
3 4 5 |
# File 'lib/brewscribe/style.rb', line 3 def ingredients @ingredients end |
#last_modified ⇒ Object
Returns the value of attribute last_modified.
3 4 5 |
# File 'lib/brewscribe/style.rb', line 3 def last_modified @last_modified end |
#letter ⇒ Object
Returns the value of attribute letter.
3 4 5 |
# File 'lib/brewscribe/style.rb', line 3 def letter @letter end |
#max_abv ⇒ Object
Returns the value of attribute max_abv.
3 4 5 |
# File 'lib/brewscribe/style.rb', line 3 def max_abv @max_abv end |
#max_carb ⇒ Object
Returns the value of attribute max_carb.
3 4 5 |
# File 'lib/brewscribe/style.rb', line 3 def max_carb @max_carb end |
#max_color ⇒ Object
Returns the value of attribute max_color.
3 4 5 |
# File 'lib/brewscribe/style.rb', line 3 def max_color @max_color end |
#max_fg ⇒ Object
Returns the value of attribute max_fg.
3 4 5 |
# File 'lib/brewscribe/style.rb', line 3 def max_fg @max_fg end |
#max_ibu ⇒ Object
Returns the value of attribute max_ibu.
3 4 5 |
# File 'lib/brewscribe/style.rb', line 3 def max_ibu @max_ibu end |
#max_og ⇒ Object
Returns the value of attribute max_og.
3 4 5 |
# File 'lib/brewscribe/style.rb', line 3 def max_og @max_og end |
#min_abv ⇒ Object
Returns the value of attribute min_abv.
3 4 5 |
# File 'lib/brewscribe/style.rb', line 3 def min_abv @min_abv end |
#min_carb ⇒ Object
Returns the value of attribute min_carb.
3 4 5 |
# File 'lib/brewscribe/style.rb', line 3 def min_carb @min_carb end |
#min_color ⇒ Object
Returns the value of attribute min_color.
3 4 5 |
# File 'lib/brewscribe/style.rb', line 3 def min_color @min_color end |
#min_fg ⇒ Object
Returns the value of attribute min_fg.
3 4 5 |
# File 'lib/brewscribe/style.rb', line 3 def min_fg @min_fg end |
#min_ibu ⇒ Object
Returns the value of attribute min_ibu.
3 4 5 |
# File 'lib/brewscribe/style.rb', line 3 def min_ibu @min_ibu end |
#min_og ⇒ Object
Returns the value of attribute min_og.
3 4 5 |
# File 'lib/brewscribe/style.rb', line 3 def min_og @min_og end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/brewscribe/style.rb', line 3 def name @name end |
#number ⇒ Object
Returns the value of attribute number.
3 4 5 |
# File 'lib/brewscribe/style.rb', line 3 def number @number end |
#profile ⇒ Object
Returns the value of attribute profile.
3 4 5 |
# File 'lib/brewscribe/style.rb', line 3 def profile @profile end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/brewscribe/style.rb', line 3 def type @type end |
#web_link ⇒ Object
Returns the value of attribute web_link.
3 4 5 |
# File 'lib/brewscribe/style.rb', line 3 def web_link @web_link end |
Class Method Details
.from_data(data) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/brewscribe/style.rb', line 30 def self.from_data data style = new style.data_to_properties data style end |