Class: Kraps::Runner::StepRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/kraps/runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(klass:, args:, kwargs:, jobs:, job_index:, step_index:, frame:) ⇒ StepRunner

Returns a new instance of StepRunner.



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/kraps/runner.rb', line 26

def initialize(klass:, args:, kwargs:, jobs:, job_index:, step_index:, frame:)
  @klass = klass
  @args = args
  @kwargs = kwargs
  @jobs = jobs
  @job_index = job_index
  @job = @jobs[@job_index]
  @step_index = step_index
  @step = @job.steps[@step_index]
  @frame = frame
end

Instance Method Details

#callObject

Raises:



38
39
40
41
42
# File 'lib/kraps/runner.rb', line 38

def call
  raise(InvalidAction, "Invalid action #{@step.action}") unless Actions::ALL.include?(@step.action)

  @step.frame ||= send(:"perform_#{@step.action}")
end