class BeerRecipe::FermentableWrapper

Public Instance Methods

amount_in_pounds() click to toggle source
# File lib/beer_recipe/fermentable_wrapper.rb, line 38
def amount_in_pounds
  amount * 2.20462
end
amount_percent() click to toggle source
# File lib/beer_recipe/fermentable_wrapper.rb, line 57
def amount_percent
  amount / @recipe.total_grains * 100
end
bitter_extract?() click to toggle source
# File lib/beer_recipe/fermentable_wrapper.rb, line 34
def bitter_extract?
  !ibu_gal_per_lb.nil?
end
color_class() click to toggle source
# File lib/beer_recipe/fermentable_wrapper.rb, line 42
def color_class
  c = color_srm.to_i
  if c > 40
    'srm-max'
  elsif c < 1
    'srm-min'
  else
    "srm#{c}"
  end
end
color_ebc() click to toggle source
# File lib/beer_recipe/fermentable_wrapper.rb, line 10
def color_ebc
  color
end
color_hex() click to toggle source
# File lib/beer_recipe/fermentable_wrapper.rb, line 53
def color_hex
  "#%02x%02x%02x" % BeerRecipe::Formula.new.srm_to_rgb(color_srm)
end
color_srm() click to toggle source
# File lib/beer_recipe/fermentable_wrapper.rb, line 14
def color_srm
  @color_srm ||= BeerRecipe::Formula.new.ebc_to_srm(color_ebc)
end
formatted_amount() click to toggle source
# File lib/beer_recipe/fermentable_wrapper.rb, line 2
def formatted_amount
  "#{'%.2f' % amount}"
end
formatted_color() click to toggle source
# File lib/beer_recipe/fermentable_wrapper.rb, line 6
def formatted_color
  "#{'%.0f' % color_ebc}"
end
ibu() click to toggle source
# File lib/beer_recipe/fermentable_wrapper.rb, line 26
def ibu
  if bitter_extract?
    amount_in_pounds * ibu_gal_per_lb / @recipe.gallons
  else
    0
  end
end
mcu() click to toggle source
# File lib/beer_recipe/fermentable_wrapper.rb, line 22
def mcu
  @mcu ||= BeerRecipe::Formula.new.mcu(amount, color_srm, @recipe.batch_size)
end
srm_in_batch() click to toggle source
# File lib/beer_recipe/fermentable_wrapper.rb, line 18
def srm_in_batch
  BeerRecipe::Formula.new.mcu_to_srm(mcu)
end