Class: BeerRecipe::TextFormatter
Instance Method Summary
collapse
#format, #format_records, #initialize, #output, #parse, #template, #template_file, #template_path
Instance Method Details
#before_fermentables ⇒ Object
25
26
27
|
# File 'lib/beer_recipe/text_formatter.rb', line 25
def before_fermentables
puts "\nFermentables:"
end
|
#before_hops ⇒ Object
33
34
35
|
# File 'lib/beer_recipe/text_formatter.rb', line 33
def before_hops
puts "\nHops:"
end
|
#before_miscs ⇒ Object
41
42
43
|
# File 'lib/beer_recipe/text_formatter.rb', line 41
def before_miscs
puts "\nMiscellaneous:"
end
|
#before_yeasts ⇒ Object
49
50
51
|
# File 'lib/beer_recipe/text_formatter.rb', line 49
def before_yeasts
puts "\nYeasts:"
end
|
29
30
31
|
# File 'lib/beer_recipe/text_formatter.rb', line 29
def format_fermentable(f)
puts "#{f.formatted_amount}\t #{f.name}"
end
|
37
38
39
|
# 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
|
14
15
16
17
18
19
|
# 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
|
21
22
23
|
# 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
|
45
46
47
|
# 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
|
2
3
4
5
6
7
8
9
10
11
12
|
# 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
|
53
54
55
|
# 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
|