module Runbook::Extensions::Steps::DSL

Public Instance Methods

step(title=nil, *tags, labels: {}, &block) click to toggle source
# File lib/runbook/extensions/steps.rb, line 4
def step(title=nil, *tags, labels: {}, &block)
  if title.is_a?(Symbol)
    tags.unshift(title)
    title = nil
  end

  Runbook::Entities::Step.new(
    title,
    tags: tags,
    labels: labels,
  ).tap do |step|
    parent.add(step)
    step.dsl.instance_eval(&block) if block
  end
end