Object
The base class of instantiation pipeline elements. All subclasses MUST implement is the call method, to define the logic that instances of that pipeline element should perform when invoked.
Create a new element instance with the given name and priority. This will call initialize_element, so that subclasses only need to implement that method if they have any initialization logic to perform.
# File lib/needle/pipeline/element.rb, line 59 def initialize( point, name=nil, priority=nil, options={} ) @service_point = point @name, @priority = name, ( priority || self.class.default_priority ) @options = options initialize_element end
Orders elements by their priority.
# File lib/needle/pipeline/element.rb, line 72 def <=>( element ) priority <=> element.priority end
Invoke this element’s logic.
# File lib/needle/pipeline/element.rb, line 77 def call( *args ) raise NotImplementedError end
Invoked by the constructor to perform any subclass-specific initialization logic.
# File lib/needle/pipeline/element.rb, line 68 def initialize_element end
Invoked by Pipeline::Collection#reset!. Subclasses of Element that save any kind of state should override this method to clear that state on demand.
# File lib/needle/pipeline/element.rb, line 84 def reset! end
Generated with the Darkfish Rdoc Generator 2.