Module: MinDI::InjectableContainer
- Includes:
- Injectable
- Defined in:
- lib/mindi.rb
Overview
An InjectableContainer “injects” itself into the services, so that they can all refer to each other.
Including this module has the combined effect of making the class act as a container (by extend-ing it with Container) and making the class Injectable (by include-ing Injectable). Additionally, including this module defines two class methods #injected and #uninjected, which determine whether subsequently defined services have the container injected into them. (The default is #injected.)
Also, the module defines an #inspect method, so that inspecting injected objects doesn’t dump the entire container and all of its services.
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
-
.included(mod) ⇒ Object
:nodoc:.
Instance Method Summary collapse
-
#inspect ⇒ Object
:nodoc:.
Methods included from Injectable
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class MinDI::Injectable
Class Method Details
.included(mod) ⇒ Object
:nodoc:
373 374 375 376 377 |
# File 'lib/mindi.rb', line 373 def self.included mod # :nodoc: mod.extend Container mod.extend InjectableContainer::ClassMethods mod.injected end |
Instance Method Details
#inspect ⇒ Object
:nodoc:
379 380 381 |
# File 'lib/mindi.rb', line 379 def inspect # :nodoc: "<#{self.class}:0x%0x>" % object_id end |