Module: Trailblazer::Activity::BuildState

Defined in:
lib/trailblazer/activity/dsl/strategy/build_state.rb

Class Method Summary collapse

Class Method Details

.build_normalizer(normalizer_class:, normalizer: false, **options) ⇒ 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.

Builds the normalizer (to process options in DSL calls) unless :normalizer is already set.



19
20
21
22
23
# File 'lib/trailblazer/activity/dsl/strategy/build_state.rb', line 19

def self.build_normalizer(normalizer_class:, normalizer: false, **options)
  normalizer, options = normalizer_class.build( options ) unless normalizer

  return normalizer, options
end

.build_state(normalizer, builder_class:, builder_options: {}, **options) ⇒ 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.



26
27
28
29
30
# File 'lib/trailblazer/activity/dsl/strategy/build_state.rb', line 26

def self.build_state(normalizer, builder_class:, builder_options: {}, **options)
  builder, adds, circuit, outputs = Magnetic::Builder::State.build(builder_class, normalizer, options.merge(builder_options))

  return builder, adds, circuit, outputs, options
end

.build_state_for(default_options, options) ⇒ Builder, ...

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.

Compute all objects that need to be passed into the new Activity module.

  1. Build the normalizer (unless passed with :normalizer)

  2. Build the builder (in State)

  3. Let State compute all state variables (that implies recompiling the Process)

Returns:

  • (Builder, Adds, Process, Outputs, remaining options)


10
11
12
13
14
# File 'lib/trailblazer/activity/dsl/strategy/build_state.rb', line 10

def self.build_state_for(default_options, options)
  options                                  = default_options.merge(options) # TODO: use Variables::Merge() here.
  normalizer, options                      = build_normalizer(options)
  builder, adds, circuit, outputs, options = build_state(normalizer, options)
end