Module: Trailblazer::Activity::DSL::Linear::Sequence::Builder
- Defined in:
- lib/trailblazer/activity/dsl/linear/sequence/builder.rb
Overview
Run a normalizer for a user DSL input, and then apply the new step using the ADDS interface to the sequence.
Class Method Summary collapse
-
.call(method, argument, options, **kws, &block) ⇒ Object
Sequence.
-
.invoke_normalizer_for(type, task, options, normalizers:, normalizer_options:, sequence:, &block) ⇒ Object
DISCUSS: used in Normalizer#add_terminus, too.
-
.update_sequence_for(type, task, options = {}, sequence:, **kws, &block) ⇒ Object
Run a specific normalizer (e.g. for ‘#step`), apply the adds to the sequence and return the latter.
Class Method Details
.call(method, argument, options, **kws, &block) ⇒ Object
Returns Sequence.
10 11 12 |
# File 'lib/trailblazer/activity/dsl/linear/sequence/builder.rb', line 10 def self.call(method, argument, , **kws, &block) update_sequence_for(method, argument, , **kws, &block) end |
.invoke_normalizer_for(type, task, options, normalizers:, normalizer_options:, sequence:, &block) ⇒ Object
DISCUSS: used in Normalizer#add_terminus, too.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/trailblazer/activity/dsl/linear/sequence/builder.rb', line 25 def self.invoke_normalizer_for(type, task, , normalizers:, normalizer_options:, sequence:, &block) # These options represent direct configuration of the very method call that causes the normalizer to be run. = { dsl_track: type, block: block, # DISCUSS: for some reason I am not entirely happy with those variables being here. Maybe this will change. normalizers: normalizers, sequence: sequence, } = normalizers.( type, normalizer_options: , # class-level Strategy configuration, such as :step_interface_builder options: task, # macro-options user_options: , # user-specified options from the DSL method library_options: # see above, "runtime" options (from compile-time, haha). ) end |
.update_sequence_for(type, task, options = {}, sequence:, **kws, &block) ⇒ Object
Run a specific normalizer (e.g. for ‘#step`), apply the adds to the sequence and return the latter. DISCUSS: where does this method belong? Sequence + Normalizers?
17 18 19 20 21 |
# File 'lib/trailblazer/activity/dsl/linear/sequence/builder.rb', line 17 def self.update_sequence_for(type, task, = {}, sequence:, **kws, &block) = invoke_normalizer_for(type, task, , sequence: sequence, **kws, &block) _sequence = Activity::Adds.apply_adds(sequence, [:adds]) end |