Sha256: cfcc350b19addf4c82116c7d135b7cec25877c1e44b445ed3d4c01de20da1b98

Contents?: true

Size: 536 Bytes

Versions: 3

Compression:

Stored size: 536 Bytes

Contents

# Describes a step in a journey. These objects get stored inside the `step_definitions`
# array of the Journey subclass. When the step gets performed, the block passed to the
# constructor will be instance_exec'd with the Journey model being the context
class StepperMotor::Step
  attr_reader :name, :wait, :seq
  def initialize(name:, seq:, wait: 0, &step_block)
    @step_block = step_block
    @name = name.to_s
    @wait = wait
    @seq = seq
  end

  # Makes the Step object itself callable
  def to_proc
    @step_block
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
stepper_motor-0.1.2 lib/stepper_motor/step.rb
stepper_motor-0.1.1 lib/stepper_motor/step.rb
stepper_motor-0.1.0 lib/stepper_motor/step.rb