Class: WebFlow::Plugin

Inherits:
Object
  • Object
show all
Defined in:
lib/webflow/plugin.rb

Overview

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

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

Direct Known Subclasses

FlowResumeValidations

Class Method Summary collapse

Class Method Details

.call(system_event) ⇒ Object

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

Raises:



33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/webflow/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(WebFlowError.new, "One of your plugin didn't return a system event, as required. The culprit is : " + self.inspect ) unless return_value.kind_of? WebFlow::SystemEvent
  
  # Act accordingly
  return return_value
      
  
end