| Class | ActionFlow::ActionStep |
| In: |
lib/action_flow/action_step.rb
|
| Parent: | ActionFlow::FlowStep |
This class allows the controllers to create action steps.
example usage :
action_step :action_name do on :success => :another_step on :back => :yet_another_step end
The method identified by :action_name will simply be called. See the wiki for more details.
Initializes the instance
# File lib/action_flow/action_step.rb, line 48 def initialize( m_action_name ) @action_name = m_action_name end
This method is required by the ActionFlow::Base and will be called once it relays the execution to this step instance
# File lib/action_flow/action_step.rb, line 59 def execute(*args) # Verify if the controller answers to the @action_name value raise ActionFlowError, "The action step #{@action_name} is not defined in your controller." unless args[0].respond_to? @action_name # The controller defines a method with the same name as @action_name. # Kewl! A 'someone else problem' !!! return args[0].send( @action_name ) end