lib/order.rb
# define method to parse CSV products into hash
define method to parse CSV products into hash
define method to parse CSV products into hash
def parse_products(products)
  products = products.split(';')
  product_hash = {}
  products.each do |product|
    product = product.split(':')
    product_hash[product[0]] = product[1].to_f
  end
  return product_hash
end
def parse_products ( products ) products = products . split ( ';' ) product_hash = { } products . each do | product | product = product . split ( ':' ) product_hash [ product [ 0 ] ] = product [ 1 ] . to_f end return product_hash end
define method to parse CSV products into hash
define method to parse CSV products into hash
products
<not_specific>