Class: Recipe

Inherits:
Object
  • Object
show all
Defined in:
lib/brewer/recipe.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(brewer) ⇒ Recipe

Returns a new instance of Recipe.



7
8
9
# File 'lib/brewer/recipe.rb', line 7

def initialize(brewer)
  @brewer = brewer
end

Instance Attribute Details

#desired_mash_tempObject

Returns the value of attribute desired_mash_temp.



5
6
7
# File 'lib/brewer/recipe.rb', line 5

def desired_mash_temp
  @desired_mash_temp
end

#grainObject

Returns the value of attribute grain.



5
6
7
# File 'lib/brewer/recipe.rb', line 5

def grain
  @grain
end

#grain_tempObject

Returns the value of attribute grain_temp.



5
6
7
# File 'lib/brewer/recipe.rb', line 5

def grain_temp
  @grain_temp
end

#mash_tempObject

Returns the value of attribute mash_temp.



5
6
7
# File 'lib/brewer/recipe.rb', line 5

def mash_temp
  @mash_temp
end

#mash_timeObject

Returns the value of attribute mash_time.



5
6
7
# File 'lib/brewer/recipe.rb', line 5

def mash_time
  @mash_time
end

#mashout_tempObject

Returns the value of attribute mashout_temp.



5
6
7
# File 'lib/brewer/recipe.rb', line 5

def mashout_temp
  @mashout_temp
end

#starting_strike_tempObject

Returns the value of attribute starting_strike_temp.



5
6
7
# File 'lib/brewer/recipe.rb', line 5

def starting_strike_temp
  @starting_strike_temp
end

#strike_water_tempObject

Returns the value of attribute strike_water_temp.



5
6
7
# File 'lib/brewer/recipe.rb', line 5

def strike_water_temp
  @strike_water_temp
end

#waterObject

Returns the value of attribute water.



5
6
7
# File 'lib/brewer/recipe.rb', line 5

def water
  @water
end

Instance Method Details

#get_recipe_vars(vars = false) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/brewer/recipe.rb', line 11

def get_recipe_vars(vars=false)
  if vars
    raise "Vars must be a hash" unless vars.is_a? Hash
    vars.each do |recipe_key, value|
      instance_variable_set("@" + recipe_key, value)
    end
  end

  puts "Variables for heating strike water"
  get_strike_temp

  puts "Variables for mash ---"
  print "Enter mash temperature: "
  @mash_temp = gets.chomp.to_f
  print "Enter mash time in minutes: "
  @mash_time = to_seconds(gets.chomp.to_f)

  puts "Variables for mashout ---"
  print "Enter mashout temp: "
  @mashout_temp = gets.chomp.to_f
end

#get_strike_tempObject



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/brewer/recipe.rb', line 33

def get_strike_temp
  print "Input amount of water in quarts: "
  @water = gets.chomp.to_f

  print "Input amount of grain in lbs: "
  @grain = gets.chomp.to_f

  print "Input current grain temp (#{@brewer.pv.to_s} F): "
  @grain_temp = gets.chomp.to_f
  if @grain_temp == ""
    @grain_temp = @brewer.pv
  end

  print "Input desired mash temp (150 F): "
  @desired_mash_temp = gets.chomp
  if @desired_mash_temp == ""
    @desired_mash_temp = 150
  end
  @desired_mash_temp

  @strike_water_temp = script('get_strike_temp', "#{@water} #{@grain} #{@grain_temp} #{@desired_mash_temp}").to_f
end