Class: Rioc::Bean::BeanFactory
- Inherits:
-
Object
- Object
- Rioc::Bean::BeanFactory
- Defined in:
- lib/rioc/bean/factory.rb
Instance Method Summary collapse
- #build_instance ⇒ Object
-
#initialize(container, name, block) ⇒ BeanFactory
constructor
Initialize the dependency factory class to build the dependency whenever the dependency is needed.
Constructor Details
#initialize(container, name, block) ⇒ BeanFactory
Initialize the dependency factory class to build the dependency whenever the dependency is needed.
7 8 9 10 11 |
# File 'lib/rioc/bean/factory.rb', line 7 def initialize(container, name, block) @container = container @name = name @block = block end |
Instance Method Details
#build_instance ⇒ Object
13 14 15 |
# File 'lib/rioc/bean/factory.rb', line 13 def build_instance @block.call(@container) end |