Class: BeerXML::MashStep

Inherits:
Brewser::MashStep show all
Includes:
ROXML
Defined in:
lib/brewser/engines/beerxml.rb

Instance Method Summary collapse

Methods inherited from Brewser::MashStep

#as_json, json_create

Methods inherited from Brewser::Model

#as_beerxml, #as_brewson, auto_migrate_down!, auto_migrate_up!, auto_upgrade!, default_repository_name

Instance Method Details

#cleanupObject



242
243
244
245
246
247
248
249
250
# File 'lib/brewser/engines/beerxml.rb', line 242

def cleanup
  self.index = mash_schedule.mash_steps.index(self)+1
  self.infusion_volume = display_infuse_amt.present? ? display_infuse_amt.u : "#{uncast_infusion_volume} l".u unless !uncast_infusion_volume.present? or uncast_infusion_volume == 0
  if infusion_temperature.present?
    self.infusion_temperature
    self.infusion_temperature = infusion_temperature.unitless? ? infusion_temperature*"1 C".u : infusion_temperature
  end
  self.rest_temperature = "#{uncast_rest_temperature} dC".u
end