attr_reader :name, :quantity, :price
@name = name
@quantity = quantity
@price = price
end
quantity * price
end
end
attr_reader :customer, :items
@customer = customer
@items = items
end
items.sum(&:total)
end
end
Order.new(
,
[
OrderItem.new(, 1, 35.0),
OrderItem.new(, 1, 12.5)
]
)
end