M
Muhammad mohsin ali Ma
What is meant by << operator?
For example this operator is used in following code,
/*****************************************************/
def add_product(product)
current_item = @items.find {|item| item.product == product}
if current_item
current_item.increment_quantity
else
current_item = CartItem.new(product)
@items << current_item
end
current_item
end
/*****************************************************/
For example this operator is used in following code,
/*****************************************************/
def add_product(product)
current_item = @items.find {|item| item.product == product}
if current_item
current_item.increment_quantity
else
current_item = CartItem.new(product)
@items << current_item
end
current_item
end
/*****************************************************/