class StepMachine::Runner::FailureTreatment

Attributes

step[RW]

Public Class Methods

new(runner, block, options) click to toggle source
# File lib/step_machine/runner.rb, line 159
def initialize(runner, block, options)
        @runner = runner
        @block = block
        @options = options
end

Public Instance Methods

continue() click to toggle source
# File lib/step_machine/runner.rb, line 184
def continue
        go_to(@step.next.name)
end
go_to(step_name) click to toggle source
# File lib/step_machine/runner.rb, line 173
def go_to(step_name)               
        @runner.next_step = @runner.step(step_name)
        @runner.continue = true
end
repeat() click to toggle source
# File lib/step_machine/runner.rb, line 178
def repeat
        go_to(@step.name)
        @runner.repeat_what = :step
        self
end
restart() click to toggle source
# File lib/step_machine/runner.rb, line 188
def restart
        go_to(@runner.first_step.name)
        @runner.repeat_what = :process
        self
end
times(number) click to toggle source
# File lib/step_machine/runner.rb, line 194
def times(number)
        @runner.times_to_repeat = number - 1
end
treat(step) click to toggle source
# File lib/step_machine/runner.rb, line 165
def treat(step)                    
        return if @options.has_key?(:only) && !@options[:only].include?(step.name)
return if @options.has_key?(:except) && @options[:except].include?(step.name)
@step = step

@block.call(self)
end