Class: BeerXML::Additive

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

Instance Method Summary collapse

Methods inherited from Brewser::Additive

#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



157
158
159
160
# File 'lib/brewser/engines/beerxml.rb', line 157

def cleanup
  self.amount = set_amount
  self.time = display_time.present? ? display_time.u : "#{time} min".u
end

#set_amountObject



151
152
153
154
155
# File 'lib/brewser/engines/beerxml.rb', line 151

def set_amount
  return display_amount.u unless display_amount.blank?
  units = weight? ? "kg" : "l"
  return "#{amount_scalar} #{units}".u
end