mindi / 0.1
| Short description: | Minimalist dependency injection | |||||
|---|---|---|---|---|---|---|
| Category: | Library/Development | |||||
| Status: | beta | |||||
| Created: | 2004-12-06 01:50:41 GMT | |||||
| Last update: | 2004-12-06 01:50:41 GMT | |||||
| Owner: | Joel VanderWerf (Projects of this owner) | |||||
| Homepage: | http://redshift.sourceforge.net/mindi/ | |||||
| Download: | http://redshift.sourceforge.net/mindi/ | |||||
| License: | Ruby's | |||||
| Dependency: |
|
|||||
| Description: | MinDI is Minimalist Dependency Injection for Ruby. It is inspired by Jamis Buck’s Needle (needle.rubyforge.org) and Jim Weirich’s article on DI in Ruby (onestepback.org/index.cgi/Tech/Ruby/DependencyInjectionInRuby.rdoc). MinDI is minimalist in that it attempts to map concepts of DI into basic ruby constructs, rather than into a layer of specialized constructs. In particular, classes and modules function as containers and registries, and methods and method definitions function as service points and services. Includes singleton, multiton, threaded, and deferred services. Synopsis
require 'mindi'
class SimpleContainer
extend MinDI::Container
string { "Hello, world\n" }
point_at { |x,y| [x,y] }
stuff { [string, point_at(100,200)] }
end
cont = SimpleContainer.new
p cont.stuff # ==> ["Hello, world\n", [100, 200]]
|
|||||
| Versions: | [0.3 (2006-04-30)] [0.1 (2004-12-06)] | |||||