Method: RulesEngine::Process.runner=

Defined in:
lib/rules_engine/process/runner.rb

.runner=(runner_options) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/rules_engine/process/runner.rb', line 13

def runner=(runner_options)
  type, *parameters = *([ runner_options ].flatten)

  case type
  when Symbol
    runner_class_name = type.to_s.camelize
    runner_class = RulesEngine::Process.const_get(runner_class_name)
    @runner = runner_class.new(*parameters)
  when nil
    @runner = nil
  else
    @runner = runner_options
  end
end