Module: StepSequencer::ClassMethods

Defined in:
lib/step_sequencer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#halt_handlerObject (readonly)

Returns the value of attribute halt_handler.



11
12
13
# File 'lib/step_sequencer.rb', line 11

def halt_handler
  @halt_handler
end

#stepsObject (readonly)

Returns the value of attribute steps.



11
12
13
# File 'lib/step_sequencer.rb', line 11

def steps
  @steps
end

Instance Method Details

#on_halt(&block) ⇒ Object



26
27
28
# File 'lib/step_sequencer.rb', line 26

def on_halt(&block)
  @halt_handler = block
end

#sequencer(&block) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/step_sequencer.rb', line 13

def sequencer(&block)
  @steps = []
  @halt_handler = proc do |step, reason|
    puts "No halt handler configured for #{self.class.name}"
    { step => reason }
  end
  instance_eval(&block)
end

#step(name) ⇒ Object



22
23
24
# File 'lib/step_sequencer.rb', line 22

def step(name)
  @steps << name
end