module Shopper::CheckoutWizard

Constants

CantAccessError
EmptyCardError

Public Instance Methods

finish_wizard_path() click to toggle source
# File lib/shopper/checkout_wizard.rb, line 21
def finish_wizard_path
  checkout_path(:complete)
end
minimal_accessible_step() click to toggle source
# File lib/shopper/checkout_wizard.rb, line 29
def minimal_accessible_step
  @manager.minimal_accessible_step
end
redirect_to_next_step() click to toggle source
# File lib/shopper/checkout_wizard.rb, line 25
def redirect_to_next_step
  redirect_to checkout_path(@manager.next_step)
end
set_manager() click to toggle source
# File lib/shopper/checkout_wizard.rb, line 17
def set_manager
  @manager = CheckoutManager.new(current_order)
end

Private Instance Methods

check_accesability() click to toggle source
# File lib/shopper/checkout_wizard.rb, line 39
def check_accesability
  raise CantAccessError unless @manager.can_access?(step)
end
check_empty_cart() click to toggle source
# File lib/shopper/checkout_wizard.rb, line 35
def check_empty_cart
  raise EmptyCardError if current_order.order_items.empty?
end