Class: Transflow::FlowDSL Private

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

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options, &block) ⇒ FlowDSL

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of FlowDSL.



17
18
19
20
21
22
# File 'lib/transflow/flow_dsl.rb', line 17

def initialize(options, &block)
  @options = options
  @container = options.fetch(:container)
  @step_map = {}
  instance_exec(&block)
end

Instance Attribute Details

#containerObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



11
12
13
# File 'lib/transflow/flow_dsl.rb', line 11

def container
  @container
end

#optionsObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



8
9
10
# File 'lib/transflow/flow_dsl.rb', line 8

def options
  @options
end

#step_mapObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



14
15
16
# File 'lib/transflow/flow_dsl.rb', line 14

def step_map
  @step_map
end

Instance Method Details

#callObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



35
36
37
# File 'lib/transflow/flow_dsl.rb', line 35

def call
  Transaction.new(step_map)
end

#step(name, options = {}, &block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



30
31
32
# File 'lib/transflow/flow_dsl.rb', line 30

def step(name, options = {}, &block)
  StepDSL.new(name, options, container, step_map, &block).call
end

#steps(*names) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



25
26
27
# File 'lib/transflow/flow_dsl.rb', line 25

def steps(*names)
  names.reverse_each { |name| step(name) }
end