Sha256: 260a89f86aa8a7c2d0fe966aaa14773088d0e761edc369ea96620ca21ee7e9c2
Contents?: true
Size: 1.34 KB
Versions: 1
Compression:
Stored size: 1.34 KB
Contents
module Trailblazer::V2_1 module Activity::Schema # Helps organizing the structure of the circuit and allows to define steps that # might be inserted in a completely different order, but it's experimental. # # Translates linear DSL calls that might refer to the same task several times into a linear "drawing instruction" # that can be consumed by Schema.bla. # # This class is experimental. class Dependencies def initialize @groups = { start: Sequence.new, main: Sequence.new, # normal steps end: Sequence.new, # ends unresolved: Sequence.new, # div } @order = [ :start, :main, :end, :unresolved ] end def add(id, seq_options, group: :main, **sequence_options) group = @groups[group] or raise "unknown group #{group}, implement me" group.add(id, seq_options, **sequence_options) # handles end def to_a @order.collect{ |name| @groups[name].to_a }.flatten(1) end # @api private def find(id) @groups.find do |name, group| index = group.send( :find_index, id ) return group, index if index end end # @api private def self.sequence_keywords [ :group, :before, :after, :replace, :delete ] end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
trailblazer-future-2.1.0.rc1 | lib/trailblazer/v2_1/activity/dsl/schema/dependencies.rb |