class FlowChart::WorkProcessor

Main Driver for WorkChart

Attributes

delegate_actions[RW]
work_owners[RW]

Public Class Methods

new(&workprocessor) click to toggle source
# File lib/flowchart/work_processor.rb, line 51
    def initialize(&workprocessor)
            @work_owners, @delegate_actions = Hash.new, Hash.new
  begin
    instance_eval(&workprocessor)
  rescue => e
    p e.backtrace
  end
end

Public Instance Methods

assigned_by_column(name = :assigned_by) click to toggle source
Default state_column is assumed to be assigned_by if not mentioned

You can override the default state_column by mentioning in your class assigned_by_column :something_else

# File lib/flowchart/work_processor.rb, line 70
def assigned_by_column(name = :assigned_by)
  @assigned_by_column ||= name
end
assigned_to_column(name = :assigned_to) click to toggle source
Default state_column is assumed to be assigned_to if not mentioned

You can override the default state_column by mentioning in your class assigned_to_column :something_else

# File lib/flowchart/work_processor.rb, line 63
def assigned_to_column(name = :assigned_to)
  @assigned_to_column ||= name
end
delegate(delegate_action_name, &block) click to toggle source
# File lib/flowchart/work_processor.rb, line 79
def delegate(delegate_action_name, &block)
    delegate_action = FlowChart::WorkDelegateAction.new(delegate_action_name,self,&block)
  @delegate_actions[delegate_action_name.to_sym] = delegate_action
end
workowner(work_owner_model, &block) click to toggle source
# File lib/flowchart/work_processor.rb, line 74
def workowner(work_owner_model, &block)
  work_owner = FlowChart::WorkOwner.new(work_owner_model,&block)
  @work_owners[work_owner_model.to_sym] = work_owner
end