# 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::LoggingInterceptor
- ::new — Needle::Pipeline::Collection
- ::new — Needle::Interceptor
- ::new — Needle::Interceptor::DynamicInterceptor
- ::new — Needle::Registry
- ::new — Needle::Pipeline::Element
- ::new — Needle::Pipeline::Collection::BlockElement
- ::new — Needle::Lifecycle::Proxy
- ::new — Needle::QueryableMutex
- ::new — Needle::Container
- ::new — Needle::DefinitionContext
- ::new — Needle::InterceptorChainBuilder::InterceptedServiceProxy
- ::new — Needle::InterceptorChainBuilder::ProxyObjectChainElement
- ::new — Needle::InterceptorChainBuilder::InterceptorChainElement
- ::new — Needle::ServicePoint
- ::new — Needle::LogFactory
- ::set_default_priority — Needle::Pipeline::Element
- #<=> — Needle::Pipeline::Element
- #[] — Needle::Container
- #[] — Needle::Pipeline::Element
- #[] — Needle::Interceptor
- #[]= — Needle::Interceptor
- #action — Needle::Interceptor
- #add — Needle::Pipeline::Collection
- #builder — Needle::Container
- #call — Needle::Lifecycle::Threaded
- #call — Needle::Pipeline::Element
- #call — Needle::Pipeline::Collection::BlockElement
- #call — Needle::Lifecycle::Initialize
- #call — Needle::Lifecycle::Singleton
- #call — Needle::Lifecycle::Deferred
- #call — Needle::Lifecycle::Multiton
- #call — Needle::Pipeline::InterceptorElement
- #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::Container
- #fullname — Needle::Registry
- #fullname — Needle::ServicePoint
- #get — Needle::Pipeline::Collection
- #get — Needle::Container
- #get — Needle::LogFactory
- #has_key? — Needle::Container
- #has_key? — Needle::DefinitionContext
- #initialize_element — Needle::Lifecycle::Initialize
- #initialize_element — Needle::Lifecycle::Multiton
- #initialize_element — Needle::Lifecycle::Singleton
- #initialize_element — Needle::Pipeline::Element
- #initialize_element — Needle::Pipeline::InterceptorElement
- #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::Lifecycle::Proxy
- #method_missing — Needle::DefinitionContext
- #namespace — Needle::Container
- #namespace — Needle::DefinitionContext
- #namespace! — Needle::DefinitionContext
- #namespace! — Needle::Container
- #namespace_define — Needle::DefinitionContext
- #namespace_define — Needle::Container
- #namespace_define! — Needle::Container
- #namespace_define! — Needle::DefinitionContext
- #new — Needle::Interceptor::DynamicInterceptor
- #next — Needle::InterceptorChainBuilder::InterceptorChainElement
- #pipeline — Needle::Container
- #process — Needle::Interceptor::DynamicInterceptor
- #process — Needle::LoggingInterceptor
- #process_next — Needle::InterceptorChainBuilder::InterceptorChainElement
- #process_next — Needle::InterceptorChainBuilder::ProxyObjectChainElement
- #progname= — Needle::Logger
- #register — Needle::Container
- #require — Needle::DefinitionContext
- #require — Needle::Container
- #reset! — Needle::Pipeline::Element
- #reset! — Needle::Lifecycle::Threaded
- #reset! — Needle::Lifecycle::Singleton
- #reset! — Needle::Lifecycle::Multiton
- #reset! — Needle::Pipeline::Collection
- #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::DefinitionContext
- #use! — Needle::Container
- #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.