Class: Dynflow::Testing::DummyExecutor
- Inherits:
-
Object
- Object
- Dynflow::Testing::DummyExecutor
- Defined in:
- lib/dynflow/testing/dummy_executor.rb
Instance Attribute Summary collapse
-
#world ⇒ Object
readonly
Returns the value of attribute world.
Instance Method Summary collapse
- #clear ⇒ Object
- #event(execution_plan_id, step_id, event, future = Future.new) ⇒ Object
-
#initialize(world) ⇒ DummyExecutor
constructor
A new instance of DummyExecutor.
- #progress ⇒ Object
Constructor Details
#initialize(world) ⇒ DummyExecutor
Returns a new instance of DummyExecutor.
6 7 8 9 |
# File 'lib/dynflow/testing/dummy_executor.rb', line 6 def initialize(world) @world = world @events_to_process = [] end |
Instance Attribute Details
#world ⇒ Object (readonly)
Returns the value of attribute world.
4 5 6 |
# File 'lib/dynflow/testing/dummy_executor.rb', line 4 def world @world end |
Instance Method Details
#clear ⇒ Object
24 25 26 |
# File 'lib/dynflow/testing/dummy_executor.rb', line 24 def clear @events_to_process.clear end |
#event(execution_plan_id, step_id, event, future = Future.new) ⇒ Object
11 12 13 |
# File 'lib/dynflow/testing/dummy_executor.rb', line 11 def event(execution_plan_id, step_id, event, future = Future.new) @events_to_process << [execution_plan_id, step_id, event, future] end |
#progress ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/dynflow/testing/dummy_executor.rb', line 15 def progress events = @events_to_process.dup clear events.each do |execution_plan_id, step_id, event, future| future.resolve true world.action.execute event end end |