Class: Toys::StandardMiddleware::ApplyConfig
- Inherits:
-
Object
- Object
- Toys::StandardMiddleware::ApplyConfig
- Defined in:
- lib/toys/standard_middleware/apply_config.rb
Overview
A middleware that applies the given block to all tool configurations.
Instance Method Summary collapse
-
#initialize(parent_source: nil, source_name: nil, &block) ⇒ ApplyConfig
constructor
Create an ApplyConfig middleware.
Constructor Details
#initialize(parent_source: nil, source_name: nil, &block) ⇒ ApplyConfig
Create an ApplyConfig middleware
19 20 21 22 23 24 25 26 27 |
# File 'lib/toys/standard_middleware/apply_config.rb', line 19 def initialize(parent_source: nil, source_name: nil, &block) @source_info = if parent_source parent_source.proc_child(block, source_name: source_name) else SourceInfo.create_proc_root(block, source_name: source_name) end @block = block end |