Class: BeerXML::Additive
Instance Method Summary
collapse
#as_json, json_create
#as_beerxml, #as_brewson, auto_migrate_down!, auto_migrate_up!, auto_upgrade!, default_repository_name
Instance Method Details
#cleanup ⇒ Object
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_amount ⇒ Object
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
|