Class ActionFlow::Plugin
In: lib/action_flow/plugin.rb
Parent: Object

This is a squeletton class to create plugins to the ActionFlow framework. Any plugin MUST me a subclass of this superclass.

Plugins are still under development so they are not activated yet.

Methods

call   listen   notify   resume  

Public Class methods

Method called by a controller when a system event for which this plugin is registered is reached.

[Source]

# File lib/action_flow/plugin.rb, line 33
    def self::call(system_event)
      
      # Execute the plugin

      return_value = self.notify
      
      # Make sure we got a system event back

      raise(ActionFlowError.new, "One of your plugin didn't return a system event, as required. The culprit is : " + self.inspect ) unless return_value.kind_of? ActionFlow::SystemEvent
      
      # Act accordingly

      return return_value
          
      
    end

Protected Class methods

Allows a plugin to register itself as a listener of the ActionFlow::Base class internal events.

[Source]

# File lib/action_flow/plugin.rb, line 63
      def self::listen(event_name)
        ActionFlow::Base.listen event_name.to_s, self
      end

Method to override in a plugin subclass. This method will be called when a controller encounters one of it‘s internal events

[Source]

# File lib/action_flow/plugin.rb, line 52
    def self::notify( system_event )
      
      raise(ActionFlowError.new, "One of your plugins didn't override the notify method. The culprit is : " + self.inspect)
      
    end

Tells the notifier that this filter has done it‘s job and other filters may do whatever the see fit.

[Source]

# File lib/action_flow/plugin.rb, line 69
      def self::resume
        ActionFlow::SystemEvent
  
  end

[Validate]