Class | Needle::Pipeline::Collection::BlockElement |
In: |
lib/needle/pipeline/collection.rb
|
Parent: | Element |
Wraps a block as a new pipeline element. When the element is invoked, control is delegated to the block.
Create a new pipeline element around the given block.
# File lib/needle/pipeline/collection.rb, line 34 34: def initialize( point, name, priority, options, block ) 35: super( point, name, priority, options ) 36: @block = block 37: end
Invoke the block. The block must accept as many parameters as the pipeline expects, plus 1 (the first parameter is always this BlockElement instance).
# File lib/needle/pipeline/collection.rb, line 42 42: def call( *args ) 43: @block.call( self, *args ) 44: end