Class: Substation::Chain::DSL::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/substation/chain/dsl/config.rb

Overview

A configuration object used with a Substation::Chain::DSL instance

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(registry, dsl_module) ⇒ undefined

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.

Initialize a new instance

Parameters:

  • registry (Hash<Symbol, Processor::Builder>)

    the registry of processor builder instances

  • dsl_module (Module)

    the module built by Builder, suitable for registry



49
50
51
# File 'lib/substation/chain/dsl/config.rb', line 49

def initialize(registry, dsl_module)
  @registry, @dsl_module = registry, dsl_module
end

Instance Attribute Details

#dsl_moduleModule (readonly)

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.

A module exposing methods to build processors defined in #registry

Returns:

  • (Module)


36
37
38
# File 'lib/substation/chain/dsl/config.rb', line 36

def dsl_module
  @dsl_module
end

#registryHash<Symbol, Processor::Builder> (readonly)

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.

The registry of processor builders

Returns:



29
30
31
# File 'lib/substation/chain/dsl/config.rb', line 29

def registry
  @registry
end

Class Method Details

.build(registry) ⇒ Config

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.

Build a new config based on #registry suitable for a Substation::Chain::DSL instance

Parameters:

Returns:



18
19
20
# File 'lib/substation/chain/dsl/config.rb', line 18

def self.build(registry)
  new(registry, ModuleBuilder.call(registry))
end