Class | Needle::Lifecycle::Singleton
In: | lib/needle/lifecycle/singleton.rb
Parent: | Needle::Pipeline::Element

The instantiation pipeline element that enforces the singleton multiplicity.

### Methods

call initialize_element reset!

### Public Instance methods

call( container, point )

Returns the cached reference, if it has been previously cached. Otherwise, invokes the next element in the pipeline and caches the result. The cached reference is returned.

initialize_element()

Creates the mutex to use and sets the cached reference to `nil`.

reset!()

Resets the cached singleton instance, so that the next time it is requested it is re-constructed.

[Validate]