Sha256: 085b4d0f29f7b0dcc7695eb784691645f0f5e735f7b806dadc8b5cadf062e653

Contents?: true

Size: 971 Bytes

Versions: 1

Compression:

Stored size: 971 Bytes

Contents

class Trailblazer::V2_1::Activity < Module
  module DSL
    module AddTask
      def add_task!(strategy, polarizer, name, task, options, &block)
        # The beautiful thing about State.add is it doesn't mutate anything.
        # We're changing state here, on the outside, by overriding the ivars.
        # That in turn means, the only mutated entity is this module.

        _builder, adds, circuit, outputs, returned_options = Magnetic::Builder::State.add( self[:builder], self[:adds], strategy, polarizer, task, options, &block ) # this could be an extension itself.

        self[:adds]    = adds
        self[:circuit] = circuit
        self[:outputs] = outputs

        _, local_options, connections, sequence_options, extension_options = returned_options

        # {Extension API} call all extensions.
        extension_options.keys.collect { |ext| ext.( self, *returned_options, original_dsl_args: [name, task, options, block] ) }
      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/add_task.rb