class PIM::Workflow::WorkflowHandler

Attributes

event[R]
parameters[R]

Public Class Methods

new(event, parameters = {}) click to toggle source
# File workflow.rb, line 11
def initialize event, parameters = {}
  @event = event
  @parameters = parameters
end

Public Instance Methods

account() click to toggle source
# File workflow.rb, line 20
def account
  parameter('account')
end
delegate_workflow(*handler_classes) click to toggle source
# File workflow.rb, line 32
def delegate_workflow *handler_classes
  handler_classes.flatten.each do |handler_class|
    next if not handler_class <= WorkflowHandler
    handler = handler_class.new(event, parameters)
    if handler.workflow
      return true
    end
  end
  return false
end
organization() click to toggle source
# File workflow.rb, line 24
def organization
  parameter('organization')
end
parameter(key) click to toggle source
# File workflow.rb, line 16
def parameter key
  parameters[key]
end
workflow(&block) click to toggle source
# File workflow.rb, line 28
def workflow &block
  self.instance_exec(&block) if block
end