Class: Brewscribe::Yeast

Inherits:
Object
  • Object
show all
Includes:
Conversion
Defined in:
lib/brewscribe/yeast.rb

Constant Summary collapse

FLOCCULATION_TYPES =
['Low', 'Medium', 'High', 'Very High']
TYPES =
['Ale', 'Lager', 'Wine', 'Champagne', 'Wheat']
FORMS =
['Liquid', 'Dry', 'Slant', 'Culture']
KEY_CONVERSION =
{
  product_id: INT_CONV,
  flocculation: ->(k) { FLOCCULATION_TYPES[k.to_i] },
  type: ->(k) { TYPES[k.to_i] },
  last_modified: DATE_CONV,
  form: ->(k) { FORMS[k.to_i] },
  starter_size: FLOAT_CONV,
  amount: FLOAT_CONV,
  price: FLOAT_CONV,
  in_recipe: BOOLEAN_CONV,
  brew_date: DATE_CONV,
  pkg_date: DATE_CONV,
  cells: FLOAT_CONV,
  min_attenuation: PERCENT_CONV,
  max_attenuation: PERCENT_CONV,
  min_temp: FLOAT_CONV,
  max_temp: FLOAT_CONV,
  use_starter: BOOLEAN_CONV,
  add_to_secondary: BOOLEAN_CONV,
  times_cultured: INT_CONV,
  max_reuse: INT_CONV,
  culture_date: DATE_CONV
}

Constants included from Conversion

Conversion::BOOLEAN_CONV, Conversion::DATE_CONV, Conversion::FLOAT_CONV, Conversion::INT_CONV, Conversion::PERCENT_CONV

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Conversion

#data_to_properties

Constructor Details

#initialize(data) ⇒ Yeast

Returns a new instance of Yeast.



38
39
40
41
42
# File 'lib/brewscribe/yeast.rb', line 38

def initialize data
  @original_data = data

  data_to_properties data
end

Instance Attribute Details

#add_to_secondaryObject (readonly)

Returns the value of attribute add_to_secondary.



3
4
5
# File 'lib/brewscribe/yeast.rb', line 3

def add_to_secondary
  @add_to_secondary
end

#amountObject (readonly)

Returns the value of attribute amount.



3
4
5
# File 'lib/brewscribe/yeast.rb', line 3

def amount
  @amount
end

#best_forObject (readonly)

Returns the value of attribute best_for.



3
4
5
# File 'lib/brewscribe/yeast.rb', line 3

def best_for
  @best_for
end

#brew_dateObject (readonly)

Returns the value of attribute brew_date.



3
4
5
# File 'lib/brewscribe/yeast.rb', line 3

def brew_date
  @brew_date
end

#cellsObject (readonly)

Returns the value of attribute cells.



3
4
5
# File 'lib/brewscribe/yeast.rb', line 3

def cells
  @cells
end

#culture_dateObject (readonly)

Returns the value of attribute culture_date.



3
4
5
# File 'lib/brewscribe/yeast.rb', line 3

def culture_date
  @culture_date
end

#flocculationObject (readonly)

Returns the value of attribute flocculation.



3
4
5
# File 'lib/brewscribe/yeast.rb', line 3

def flocculation
  @flocculation
end

#formObject (readonly)

Returns the value of attribute form.



3
4
5
# File 'lib/brewscribe/yeast.rb', line 3

def form
  @form
end

#in_recipeObject (readonly)

Returns the value of attribute in_recipe.



3
4
5
# File 'lib/brewscribe/yeast.rb', line 3

def in_recipe
  @in_recipe
end

#labObject (readonly)

Returns the value of attribute lab.



3
4
5
# File 'lib/brewscribe/yeast.rb', line 3

def lab
  @lab
end

#last_modifiedObject (readonly)

Returns the value of attribute last_modified.



3
4
5
# File 'lib/brewscribe/yeast.rb', line 3

def last_modified
  @last_modified
end

#max_attenuationObject (readonly)

Returns the value of attribute max_attenuation.



3
4
5
# File 'lib/brewscribe/yeast.rb', line 3

def max_attenuation
  @max_attenuation
end

#max_reuseObject (readonly)

Returns the value of attribute max_reuse.



3
4
5
# File 'lib/brewscribe/yeast.rb', line 3

def max_reuse
  @max_reuse
end

#max_tempObject (readonly)

Returns the value of attribute max_temp.



3
4
5
# File 'lib/brewscribe/yeast.rb', line 3

def max_temp
  @max_temp
end

#min_attenuationObject (readonly)

Returns the value of attribute min_attenuation.



3
4
5
# File 'lib/brewscribe/yeast.rb', line 3

def min_attenuation
  @min_attenuation
end

#min_tempObject (readonly)

Returns the value of attribute min_temp.



3
4
5
# File 'lib/brewscribe/yeast.rb', line 3

def min_temp
  @min_temp
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/brewscribe/yeast.rb', line 3

def name
  @name
end

#notesObject (readonly)

Returns the value of attribute notes.



3
4
5
# File 'lib/brewscribe/yeast.rb', line 3

def notes
  @notes
end

#pkg_dateObject (readonly)

Returns the value of attribute pkg_date.



3
4
5
# File 'lib/brewscribe/yeast.rb', line 3

def pkg_date
  @pkg_date
end

#priceObject (readonly)

Returns the value of attribute price.



3
4
5
# File 'lib/brewscribe/yeast.rb', line 3

def price
  @price
end

#product_idObject (readonly)

Returns the value of attribute product_id.



3
4
5
# File 'lib/brewscribe/yeast.rb', line 3

def product_id
  @product_id
end

#starter_sizeObject (readonly)

Returns the value of attribute starter_size.



3
4
5
# File 'lib/brewscribe/yeast.rb', line 3

def starter_size
  @starter_size
end

#times_culturedObject (readonly)

Returns the value of attribute times_cultured.



3
4
5
# File 'lib/brewscribe/yeast.rb', line 3

def times_cultured
  @times_cultured
end

#typeObject (readonly)

Returns the value of attribute type.



3
4
5
# File 'lib/brewscribe/yeast.rb', line 3

def type
  @type
end

#use_starterObject (readonly)

Returns the value of attribute use_starter.



3
4
5
# File 'lib/brewscribe/yeast.rb', line 3

def use_starter
  @use_starter
end