Class: IntegrationWorkflow

Inherits:
Object
  • Object
show all
Defined in:
lib/integration_workflow.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}, &block) ⇒ IntegrationWorkflow

Returns a new instance of IntegrationWorkflow.



7
8
9
10
11
# File 'lib/integration_workflow.rb', line 7

def initialize(options = {}, &block)
  @steps = []
  @options = options
  instance_exec(&block) if block_given?
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/integration_workflow.rb', line 5

def options
  @options
end

#stepsObject (readonly)

Returns the value of attribute steps.



5
6
7
# File 'lib/integration_workflow.rb', line 5

def steps
  @steps
end

Instance Method Details

#runObject



18
19
20
# File 'lib/integration_workflow.rb', line 18

def run
  steps.each(&:run)
end

#step(name, &block) ⇒ Object



13
14
15
16
# File 'lib/integration_workflow.rb', line 13

def step(name, &block)
  step = Step.new(name, options, &block)
  steps << step
end