Class: ShoppingCart::CheckoutUpdater
- Inherits:
-
Rectify::Command
- Object
- Rectify::Command
- ShoppingCart::CheckoutUpdater
- Defined in:
- app/services/shopping_cart/checkout_updater.rb
Constant Summary collapse
- STEPS =
{ address: :update_address, delivery: :update_delivery, payment: :update_credit_card, confirm: :confirm_order }.freeze
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(step:, params:, order:, user:) ⇒ CheckoutUpdater
constructor
A new instance of CheckoutUpdater.
Constructor Details
#initialize(step:, params:, order:, user:) ⇒ CheckoutUpdater
Returns a new instance of CheckoutUpdater.
10 11 12 13 14 15 |
# File 'app/services/shopping_cart/checkout_updater.rb', line 10 def initialize(step:, params:, order:, user:) @step = step @params = params @order = order @user = user end |
Instance Method Details
#call ⇒ Object
17 18 19 |
# File 'app/services/shopping_cart/checkout_updater.rb', line 17 def call send(STEPS[@step]) if STEPS[@step] end |