Class: FlowObject::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_object/runner.rb

Overview

Triggers flow execution and users callbacks

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(plan, callbacks, halt_if_proc) ⇒ Runner

Returns a new instance of Runner.



8
9
10
11
12
13
14
15
# File 'lib/flow_object/runner.rb', line 8

def initialize(plan, callbacks, halt_if_proc)
  @plan = plan
  @flow = flow
  @failure = false
  @step_name = nil
  @callbacks = callbacks
  @halt_if_proc = halt_if_proc
end

Instance Attribute Details

#callbacksObject (readonly)

Returns the value of attribute callbacks.



6
7
8
# File 'lib/flow_object/runner.rb', line 6

def callbacks
  @callbacks
end

#failureObject (readonly)

Returns the value of attribute failure.



6
7
8
# File 'lib/flow_object/runner.rb', line 6

def failure
  @failure
end

#flowObject (readonly)

Returns the value of attribute flow.



6
7
8
# File 'lib/flow_object/runner.rb', line 6

def flow
  @flow
end

#step_nameObject (readonly)

Returns the value of attribute step_name.



6
7
8
# File 'lib/flow_object/runner.rb', line 6

def step_name
  @step_name
end

Instance Method Details

#execute_planObject



17
18
19
20
# File 'lib/flow_object/runner.rb', line 17

def execute_plan
  @flow = flow_builder.call
  self
end