Class: Dunlop::OverdueHandling::DefinitionProxy

Inherits:
Object
  • Object
show all
Defined in:
app/services/dunlop/overdue_handling.rb

Instance Method Summary collapse

Instance Method Details

#the_final_states_are(states) ⇒ Object



49
50
51
# File 'app/services/dunlop/overdue_handling.rb', line 49

def the_final_states_are(states)
  Dunlop::OverdueHandling.final_states = states
end

#when_workflow_step(workflow_step, options = {}, &block) ⇒ Object



41
42
43
44
45
46
47
# File 'app/services/dunlop/overdue_handling.rb', line 41

def when_workflow_step(workflow_step, options = {}, &block)
  raise "Workflow step #{workflow_step} does not exist" unless WorkflowInstance.possible_workflow_step_names.include?(workflow_step)
  workflow_step_proxy = WorkflowStepProxy.new(workflow_step, options)
  workflow_step_proxy.instance_eval(&block) if block
  workflow_step_proxy.register_callbacks!
  Dunlop::OverdueHandling.registry[workflow_step] = workflow_step_proxy
end