# needle-1.3.0 Documentation

Needle is a Dependency Injection container, similar in goal to HiveMind, Spring, and PicoContainer (in the Java universe), but vastly different in implementation. It takes advantage of the dynamic features in Ruby, especially closures and `instance_eval`.

- Project page: rubyforge.org/projects/needle

- User Manual: needle.rubyforge.org

- API Documentation: needle.rubyforge.org/api

- Needle Wiki: needle.rubyforge.org/wiki/wiki.pl

For an excellent overview of dependency injection, have a look at "Dependency Injection in Ruby" (files/doc/di-in-ruby_rdoc.html).

## Downloading

You may download Needle from Needle's RubyForge project, at rubyforge.org/projects/needle. Needle is distributed both as a RubyGem, and as a Ruby library. It is also available from the RPA.

## Installation

Needle is distributed as a gem, which makes it extremely easy to download, install, and use. However, it requires that you have RubyGems installed, first.

Assuming you have RubyGems installed, all you have to do is:

    gem --remote-install needle

This will install the latest version of Needle.

Needle is also distributed as a Ruby library. It's not as easy to install this way, but it works. Simply grab the latest Needle package from the website, untar it, and install it by typing:

    ruby setup.rb

Or, if you want a little more control over the installation:

    ruby setup.rb --help

This will show you the options that are available to you, and then you can do each stage of the installation manually:

    ruby setup.rb config
    ruby setup.rb setup
    ruby setup.rb install

## Manual

For more information about Needle, such as an overview and tutorials, see the Needle manual at needle.rubyforge.org.

## Credits

Thanks go to:

- Matz, for creating Ruby in the first place.

- Jim Weirich, for his inspirational blog article "Dependency Injection in Ruby" (onestepback.org/index.cgi/Tech/Ruby/DependencyInjectionInRuby.rdoc) that formed the embryo of what Needle has eventually become.

## License

Needle is copyright (c) 2004 Jamis Buck. It is open-source software, and may be redistributed under the terms of the BSD or Ruby licenses. The texts of these licences are included in the Needle distribution, under the `doc` subdirectory.

The Needle manual and all software used to build it are distributed under the Attribution-ShareAlike 1.0 Creative Commons license. Distribute it and modify it all you want, but give me credit and distribute your changes under an identical license.

## Files

- README

## Classes/Modules

- Needle
- Needle::Bug
- Needle::Container
- Needle::DefinitionContext
- Needle::IncludeExclude
- Needle::Interceptor
- Needle::Interceptor::DynamicInterceptor
- Needle::InterceptorChainBuilder
- Needle::InterceptorChainBuilder::InterceptedServiceProxy
- Needle::InterceptorChainBuilder::InterceptorChainElement
- Needle::InterceptorChainBuilder::ProxyObjectChainElement
- Needle::InterceptorConfigurationError
- Needle::Lifecycle
- Needle::Lifecycle::Deferred
- Needle::Lifecycle::Initialize
- Needle::Lifecycle::Multiton
- Needle::Lifecycle::Proxy
- Needle::Lifecycle::Singleton
- Needle::Lifecycle::Threaded
- Needle::LogFactory
- Needle::Logger
- Needle::LoggingInterceptor
- Needle::NeedleError
- Needle::Pipeline
- Needle::Pipeline::Collection
- Needle::Pipeline::Collection::BlockElement
- Needle::Pipeline::Element
- Needle::Pipeline::InterceptorElement
- Needle::QueryableMutex
- Needle::Registry
- Needle::ServiceNotFound
- Needle::ServicePoint
- Needle::Version

## Methods

- ::build — Needle::InterceptorChainBuilder
- ::define — Needle::Registry
- ::define! — Needle::Registry
- ::new — Needle::Pipeline::Collection::BlockElement
- ::new — Needle::Lifecycle::Proxy
- ::new — Needle::DefinitionContext
- ::new — Needle::QueryableMutex
- ::new — Needle::ServicePoint
- ::new — Needle::Registry
- ::new — Needle::Pipeline::Element
- ::new — Needle::Pipeline::Collection
- ::new — Needle::LoggingInterceptor
- ::new — Needle::LogFactory
- ::new — Needle::Interceptor::DynamicInterceptor
- ::new — Needle::Interceptor
- ::new — Needle::InterceptorChainBuilder::InterceptedServiceProxy
- ::new — Needle::InterceptorChainBuilder::ProxyObjectChainElement
- ::new — Needle::InterceptorChainBuilder::InterceptorChainElement
- ::new — Needle::Container
- ::set_default_priority — Needle::Pipeline::Element
- #<=> — Needle::Pipeline::Element
- #[] — Needle::Container
- #[] — Needle::Interceptor
- #[] — Needle::Pipeline::Element
- #[]= — Needle::Interceptor
- #action — Needle::Interceptor
- #add — Needle::Pipeline::Collection
- #builder — Needle::Container
- #call — Needle::Lifecycle::Deferred
- #call — Needle::Lifecycle::Multiton
- #call — Needle::Lifecycle::Initialize
- #call — Needle::Pipeline::Collection::BlockElement
- #call — Needle::Pipeline::Element
- #call — Needle::Pipeline::InterceptorElement
- #call — Needle::Lifecycle::Singleton
- #call — Needle::Lifecycle::Threaded
- #chain_to — Needle::Pipeline::Collection
- #close — Needle::LogFactory
- #closed? — Needle::LogFactory
- #define — Needle::Container
- #define! — Needle::Container
- #descended_from? — Needle::Container
- #doing — Needle::Interceptor
- #find_definition — Needle::Container
- #fullname — Needle::Registry
- #fullname — Needle::Container
- #fullname — Needle::ServicePoint
- #get — Needle::Pipeline::Collection
- #get — Needle::Container
- #get — Needle::LogFactory
- #has_key? — Needle::DefinitionContext
- #has_key? — Needle::Container
- #initialize_element — Needle::Pipeline::InterceptorElement
- #initialize_element — Needle::Pipeline::Element
- #initialize_element — Needle::Lifecycle::Multiton
- #initialize_element — Needle::Lifecycle::Singleton
- #initialize_element — Needle::Lifecycle::Initialize
- #inspect — Needle::Lifecycle::Proxy
- #instance — Needle::ServicePoint
- #intercept — Needle::Container
- #intercept — Needle::DefinitionContext
- #interceptor — Needle::ServicePoint
- #keys — Needle::Container
- #knows_key? — Needle::DefinitionContext
- #knows_key? — Needle::Container
- #lock — Needle::QueryableMutex
- #message_format= — Needle::Logger
- #method_missing — Needle::Container
- #method_missing — Needle::DefinitionContext
- #method_missing — Needle::Lifecycle::Proxy
- #namespace — Needle::DefinitionContext
- #namespace — Needle::Container
- #namespace! — Needle::DefinitionContext
- #namespace! — Needle::Container
- #namespace_define — Needle::Container
- #namespace_define — Needle::DefinitionContext
- #namespace_define! — Needle::DefinitionContext
- #namespace_define! — Needle::Container
- #new — Needle::Interceptor::DynamicInterceptor
- #next — Needle::InterceptorChainBuilder::InterceptorChainElement
- #pipeline — Needle::Container
- #process — Needle::Interceptor::DynamicInterceptor
- #process — Needle::LoggingInterceptor
- #process_next — Needle::InterceptorChainBuilder::ProxyObjectChainElement
- #process_next — Needle::InterceptorChainBuilder::InterceptorChainElement
- #progname= — Needle::Logger
- #register — Needle::Container
- #require — Needle::Container
- #require — Needle::DefinitionContext
- #reset! — Needle::Lifecycle::Singleton
- #reset! — Needle::Lifecycle::Multiton
- #reset! — Needle::Pipeline::Collection
- #reset! — Needle::Pipeline::Element
- #reset! — Needle::Lifecycle::Threaded
- #respond_to? — Needle::Container
- #root — Needle::Container
- #self_locked? — Needle::QueryableMutex
- #service_cache — Needle::Lifecycle::Threaded
- #this_container — Needle::DefinitionContext
- #try_lock — Needle::QueryableMutex
- #unlock — Needle::QueryableMutex
- #use — Needle::Container
- #use — Needle::DefinitionContext
- #use! — Needle::Container
- #use! — Needle::DefinitionContext
- #with — Needle::Interceptor
- #with! — Needle::Interceptor
- #with_options — Needle::Interceptor
- #write_to — Needle::Logger
- #write_to — Needle::LogFactory

[Validate]

Generated with the Darkfish Rdoc Generator 2.