# frozen_string_literal: true # This class is responsible for adding line items to order without going # through order contents. module SolidusSubscriptions class OrderBuilder attr_reader :order # Get a new instance of an OrderBuilder # # @param order [Spree::Order] The order to be built # # @return [SolidusSubscriptions::OrderBuilder] def initialize(order) @order = order end # Add line items to an order. If the order already # has a line item for a given variant_id, update the quantity. Otherwise # add the line item to the order. # # @param items [Array] The order to add the line item to # @return [Array