Class: Rioc::Bean::BeanFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/rioc/bean/factory.rb

Instance Method Summary collapse

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_instanceObject



13
14
15
# File 'lib/rioc/bean/factory.rb', line 13

def build_instance
  @block.call(@container)
end