Class: EventMachine::Scenario::AbInitio

Inherits:
Object
  • Object
show all
Includes:
EM::Deferrable
Defined in:
lib/scenario/latin.rb

Overview

Sequences of actions.

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ AbInitio

Returns a new instance of AbInitio.



14
15
16
17
18
# File 'lib/scenario/latin.rb', line 14

def initialize &block
  @actions = AbInitioActions.new
  block.call @actions
  self
end

Instance Method Details

#finally(&block) ⇒ Object



28
29
30
31
32
# File 'lib/scenario/latin.rb', line 28

def finally &block
  self.callback &block
  @actions.actions.reverse!
  self.nextStep
end

#nextStepObject



20
21
22
23
24
25
26
# File 'lib/scenario/latin.rb', line 20

def nextStep
  if @actions.actions.length > 0
    @actions.actions.pop.succeed(Proc.new { nextStep })
  else
    self.succeed
  end
end