Module: Card::Director::Run

Included in:
Card::Director
Defined in:
card/lib/card/director/run.rb

Overview

methods for running stages

Instance Method Summary collapse

Instance Method Details

#catch_up_to_stage(next_stage) ⇒ Object



5
6
7
8
9
10
11
# File 'card/lib/card/director/run.rb', line 5

def catch_up_to_stage next_stage
  return if @delay && before?(:integrate_with_delay, next_stage)

  upto_stage(next_stage) do |stage|
    run_stage stage
  end
end

#delay!Object



21
22
23
# File 'card/lib/card/director/run.rb', line 21

def delay!
  @delay = true
end

#restartObject



25
26
27
28
# File 'card/lib/card/director/run.rb', line 25

def restart
  @running = false
  @stage = nil
end

#run_delayed_event(act) ⇒ Object



13
14
15
16
17
18
19
# File 'card/lib/card/director/run.rb', line 13

def run_delayed_event act
  @running = true
  @act = act
  @stage = stage_index :integrate_with_delay
  yield
  run_subcard_stages :integrate_with_delay
end