class Needle::Pipeline::Collection::BlockElement
Wraps a block as a new pipeline element. When the element is invoked, control is delegated to the block.
Public Class Methods
new( point, name, priority, options, block )
click to toggle source
Create a new pipeline element around the given block.
Calls superclass method
# File lib/needle/pipeline/collection.rb, line 34 def initialize( point, name, priority, options, block ) super( point, name, priority, options ) @block = block end
Public Instance Methods
call( *args )
click to toggle source
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 def call( *args ) @block.call( self, *args ) end