Method: Strategy::Plan#execute!
- Defined in:
- lib/strategy/plan.rb
#execute! ⇒ Object
Iterate over all steps contained in the plan and execute them. This method will yield the step number and description if a block is given, which enables one to print out a step banner just before execution if desired.
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/strategy/plan.rb', line 39 def execute! n = 0 @steps.each do |step| n += 1 if block_given? yield n, step.description end step.execute! end end |