Class: ShoppingCart::CreateOrderItem
- Inherits:
-
Rectify::Command
- Object
- Rectify::Command
- ShoppingCart::CreateOrderItem
- Defined in:
- app/services/shopping_cart/create_order_item.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(params:, order:) ⇒ CreateOrderItem
constructor
A new instance of CreateOrderItem.
Constructor Details
#initialize(params:, order:) ⇒ CreateOrderItem
Returns a new instance of CreateOrderItem.
3 4 5 6 |
# File 'app/services/shopping_cart/create_order_item.rb', line 3 def initialize(params:, order:) @params = params @order = order end |
Instance Method Details
#call ⇒ Object
8 9 10 11 12 |
# File 'app/services/shopping_cart/create_order_item.rb', line 8 def call create_order unless @order find_order_item ? update_order_item_quantity : create_new_order_item broadcast(:ok) end |