Class: Substation::Environment
- Inherits:
-
Object
- Object
- Substation::Environment
- Includes:
- Adamantium::Flat
- Defined in:
- lib/substation/environment.rb,
lib/substation/environment/dsl.rb
Overview
The environment holding all registered Chain processors
Defined Under Namespace
Classes: DSL
Class Method Summary collapse
-
.build(&block) ⇒ Environment
private
Build a new Environment instance.
Instance Method Summary collapse
-
#chain(other = Chain::EMPTY, &block) ⇒ Chain
private
Build a new Chain instance.
-
#initialize(registry) ⇒ undefined
constructor
private
Initialize a new instance.
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
29 30 31 32 |
# File 'lib/substation/environment.rb', line 29 def initialize(registry) @registry = registry @chain_dsl = Chain::DSL::Builder.call(@registry) end |
Class Method Details
.build(&block) ⇒ Environment
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::Environment instance
17 18 19 |
# File 'lib/substation/environment.rb', line 17 def self.build(&block) new(DSL.registry(&block)) end |
Instance Method Details
#chain(other = Chain::EMPTY, &block) ⇒ Chain
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 Chain instance
45 46 47 |
# File 'lib/substation/environment.rb', line 45 def chain(other = Chain::EMPTY, &block) Chain.build(@chain_dsl, other, &block) end |