github.com/artworx/pico_container
master / published Jan 30, 2019 / repository
pico_container
Minimal DI container
Installation
Add this to your application's shard.yml:
dependencies:
pico_container:
github: artworx/pico_container
Usage
require "pico_container"
class Dependency
inject
end
class Example
inject Dependency
def initialize(@dependency : Dependency)
end
end
class Container
include PicoContainer
end
container = Container.new
p container.create(Example)
#<Example:0x1c0bd80 @dependency=#<Dependency:0x1c0af20>>
Development
TODO: Write development instructions here
Contributing
- Fork it ( https://github.com/artworx/pico_container/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- artworx Alexandru Keszeg - creator, maintainer