class BeerRecipe::TextFormatter

Public Instance Methods

before_fermentables() click to toggle source
# File lib/beer_recipe/text_formatter.rb, line 25
def before_fermentables
  puts "\nFermentables:"
end
before_hops() click to toggle source
# File lib/beer_recipe/text_formatter.rb, line 33
def before_hops
  puts "\nHops:"
end
before_miscs() click to toggle source
# File lib/beer_recipe/text_formatter.rb, line 41
def before_miscs
  puts "\nMiscellaneous:"
end
before_yeasts() click to toggle source
# File lib/beer_recipe/text_formatter.rb, line 49
def before_yeasts
  puts "\nYeasts:"
end
format_fermentable(f) click to toggle source
# File lib/beer_recipe/text_formatter.rb, line 29
def format_fermentable(f)
  puts "#{f.formatted_amount}\t #{f.name}"
end
format_hop(h) click to toggle source
# File lib/beer_recipe/text_formatter.rb, line 37
def format_hop(h)
  puts "#{h.formatted_amount}\t#{h.name} (#{h.form})\t#{h.use}\t#{h.formatted_time}\t#{h.formatted_ibu}"
end
format_mash(mash) click to toggle source
# File lib/beer_recipe/text_formatter.rb, line 14
def format_mash(mash)
  puts "\nMash:"
  puts mash.name
  puts
  format_records(mash.steps, :mashstep)
end
format_mash_step(m) click to toggle source
# File lib/beer_recipe/text_formatter.rb, line 21
def format_mash_step(m)
  puts "#{m.name}\t#{m.type}\t#{'%.2f' % m.infuse_amount} L\t#{m.formatted_step_time}\t#{m.formatted_step_temp}"
end
format_misc(m) click to toggle source
# File lib/beer_recipe/text_formatter.rb, line 45
def format_misc(m)
  puts "#{m.name}\t#{m.formatted_amount} #{m.unit}\t#{m.formatted_time} #{m.time_unit}"
end
format_recipe() click to toggle source
# File lib/beer_recipe/text_formatter.rb, line 2
def format_recipe
  puts "Name: #{@recipe.name}"
  puts "Type: #{@recipe.type}"
  puts "Style: #{@recipe.style.name}"
  puts "Batch size: #{'%.0f' % @recipe.batch_size} L"
  puts "Boil time: #{'%.0f' % @recipe.boil_time} min"
  puts "OG: #{@recipe.og}"
  puts "FG: #{@recipe.fg}"
  puts "ABV: #{'%.2f' % @recipe.abv}%"
  puts "IBU: #{'%.0f' % @recipe.ibu}"
end
format_yeast(y) click to toggle source
# File lib/beer_recipe/text_formatter.rb, line 53
def format_yeast(y)
  puts "#{y.name}\t#{y.product_id}\t#{y.laboratory}\t#{y.form}"
end