Module: Opensteam::Checkout::InstanceMethods

Defined in:
lib/opensteam/checkout.rb

Instance Method Summary collapse

Instance Method Details

#create_checkout_flow(target = self) {|target| ... } ⇒ Object

Yields:

  • (target)


69
70
71
# File 'lib/opensteam/checkout.rb', line 69

def create_checkout_flow( target = self )
  yield target if block_given?
end

#current_stepObject

save the current-action name in the sessions



57
58
59
# File 'lib/opensteam/checkout.rb', line 57

def current_step
  session[:current_action] = self.action_name
end

#endstepObject

method to finish the checkout-process and redirect_to the action specified by :finish



64
65
66
# File 'lib/opensteam/checkout.rb', line 64

def endstep
  redirect_to_step(:finish)
end

#invokeObject

start the checkout process and redirect_to the action specified by :start



76
77
78
# File 'lib/opensteam/checkout.rb', line 76

def invoke
  redirect_to_step(:start)
end

#on(sym, hash) ⇒ Object

define a flow step

on :start, :intro
on :finish, :controller => "webshop", :action => "index"


85
86
87
# File 'lib/opensteam/checkout.rb', line 85

def on(sym, hash)
  steps.store( sym, hash )
end