Class: Leash::Step
- Inherits:
-
Object
- Object
- Leash::Step
- Defined in:
- lib/leash/step.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
Instance Method Summary collapse
-
#initialize(description:, action:) ⇒ Step
constructor
A new instance of Step.
- #run ⇒ Object
Constructor Details
#initialize(description:, action:) ⇒ Step
Returns a new instance of Step.
7 8 9 10 |
# File 'lib/leash/step.rb', line 7 def initialize(description:, action:) @description = description @action = action end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
5 6 7 |
# File 'lib/leash/step.rb', line 5 def action @action end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
5 6 7 |
# File 'lib/leash/step.rb', line 5 def description @description end |
Instance Method Details
#run ⇒ Object
12 13 14 |
# File 'lib/leash/step.rb', line 12 def run action&.call end |