Class: StepperMotor::Step
- Inherits:
-
Object
- Object
- StepperMotor::Step
- Defined in:
- lib/stepper_motor/step.rb
Overview
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
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#seq ⇒ Object
readonly
Returns the value of attribute seq.
-
#wait ⇒ Object
readonly
Returns the value of attribute wait.
Instance Method Summary collapse
-
#initialize(name:, seq:, wait: 0, &step_block) ⇒ Step
constructor
A new instance of Step.
-
#to_proc ⇒ Object
Makes the Step object itself callable.
Constructor Details
#initialize(name:, seq:, wait: 0, &step_block) ⇒ Step
Returns a new instance of Step.
6 7 8 9 10 11 |
# File 'lib/stepper_motor/step.rb', line 6 def initialize(name:, seq:, wait: 0, &step_block) @step_block = step_block @name = name.to_s @wait = wait @seq = seq end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/stepper_motor/step.rb', line 5 def name @name end |
#seq ⇒ Object (readonly)
Returns the value of attribute seq.
5 6 7 |
# File 'lib/stepper_motor/step.rb', line 5 def seq @seq end |
#wait ⇒ Object (readonly)
Returns the value of attribute wait.
5 6 7 |
# File 'lib/stepper_motor/step.rb', line 5 def wait @wait end |
Instance Method Details
#to_proc ⇒ Object
Makes the Step object itself callable
14 15 16 |
# File 'lib/stepper_motor/step.rb', line 14 def to_proc @step_block end |