Class: Substation::Chain::DSL::Builder

Inherits:
Object
  • Object
show all
Includes:
Adamantium::Flat
Defined in:
lib/substation/chain/dsl.rb

Overview

The class that builds a DSL class suitable for an Environment

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(registry) ⇒ 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, #call>)

    the registry of processors used in an Environment



57
58
59
60
# File 'lib/substation/chain/dsl.rb', line 57

def initialize(registry)
  @registry = registry
  @dsl      = compile_dsl
end

Instance Attribute Details

#dslClass<DSL> (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 built DSL subclass

Returns:



47
48
49
# File 'lib/substation/chain/dsl.rb', line 47

def dsl
  @dsl
end

Class Method Details

.call(registry) ⇒ Class<DSL>

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 Substation::Chain::DSL subclass targeted for an Environment

Parameters:

  • registry (Hash<Symbol, #call>)

    the registry of processors used in an Environment

Returns:



38
39
40
# File 'lib/substation/chain/dsl.rb', line 38

def self.call(registry)
  new(registry).dsl
end