Class | Needle::Pipeline::Element
In: | lib/needle/pipeline/element.rb
Parent: | 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.

### Methods

<=> [] call initialize_element new reset! set_default_priority

### Included Modules

Comparable

### Attributes

default_priority | [R] | The default priority to use for elements of this type.
name | [R] | The name of this element (may be `nil`).
options | [R] | The hash of options that were given to this element.
priority | [R] | The priority of this element, used to determine ordering. Higher ordered elements are invoked before lower-ordered elements.
service_point | [R] | The service definition that this element belongs to.
succ | [RW] | The next element in the chain. This value is only valid during pipeline execution—its value should not be relied upon at any other time.

### Public Class methods

new( point, name=nil, priority=nil, options={} )

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.

set_default_priority( priority )

Set the default priority for elements of this type. Subclasses may use this method to set their default priority.

### Public Instance methods

<=>( element )

Orders elements by their priority.

[]( *args )

Alias for call

call( *args )

Invoke this element‘s logic.

initialize_element()

Invoked by the constructor to perform any subclass-specific initialization logic.

reset!()

Invoked by Pipeline::Collection#reset!. Subclasses of Element that save any kind of state should override this method to clear that state on demand.

[Validate]