Class: IocRb::Scopes::PrototypeScope
- Defined in:
- lib/ioc_rb/scopes/prototype_scope.rb
Overview
Prototype scope instantiates new bean instance on each get_bean
call
Instance Method Summary collapse
-
#delete_bean(bean_metadata) ⇒ Object
Delete bean from scope, because Prototype scope doesn’t store bean then do nothing here.
-
#get_bean(bean_metadata) ⇒ Object
Get new bean instance.
-
#initialize(bean_factory) ⇒ PrototypeScope
constructor
Constructon.
Constructor Details
#initialize(bean_factory) ⇒ PrototypeScope
Constructon
7 8 9 |
# File 'lib/ioc_rb/scopes/prototype_scope.rb', line 7 def initialize(bean_factory) @bean_factory = bean_factory end |
Instance Method Details
#delete_bean(bean_metadata) ⇒ Object
Delete bean from scope, because Prototype scope doesn’t store bean then do nothing here
23 24 |
# File 'lib/ioc_rb/scopes/prototype_scope.rb', line 23 def delete_bean() end |
#get_bean(bean_metadata) ⇒ Object
Get new bean instance
14 15 16 |
# File 'lib/ioc_rb/scopes/prototype_scope.rb', line 14 def get_bean() @bean_factory.create_bean_and_save(, {}) end |