Class: Trailblazer::Activity::DSL::Linear::State::Normalizer
- Inherits:
-
Object
- Object
- Trailblazer::Activity::DSL::Linear::State::Normalizer
- Defined in:
- lib/trailblazer/activity/dsl/linear/state.rb
Overview
Compiles and maintains all final normalizers for a specific DSL.
Instance Method Summary collapse
-
#call(name, ctx) ⇒ Object
Execute the specific normalizer (step, fail, pass) for a particular option set provided by the DSL user.
-
#initialize(normalizer_sequences) ⇒ Normalizer
constructor
[gets instantiated at compile time.].
Constructor Details
#initialize(normalizer_sequences) ⇒ Normalizer
- gets instantiated at compile time.
-
We simply compile the activities that represent the normalizers for #step, #pass, etc. This can happen at compile-time, as normalizers are stateless.
46 47 48 |
# File 'lib/trailblazer/activity/dsl/linear/state.rb', line 46 def initialize(normalizer_sequences) @normalizers = normalizer_sequences end |
Instance Method Details
#call(name, ctx) ⇒ Object
Execute the specific normalizer (step, fail, pass) for a particular option set provided by the DSL user. This is usually when you call Operation::step.
52 53 54 55 56 |
# File 'lib/trailblazer/activity/dsl/linear/state.rb', line 52 def call(name, ctx) normalizer = @normalizers.fetch(name) wrap_ctx, _ = normalizer.(ctx, nil) wrap_ctx end |