Class: IoC::Dependency
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(value, singleton: false) ⇒ Dependency
constructor
A new instance of Dependency.
Constructor Details
#initialize(value, singleton: false) ⇒ Dependency
Returns a new instance of Dependency.
5 6 7 8 |
# File 'lib/ioc/dependency.rb', line 5 def initialize(value, singleton: false) @value = value @singleton = singleton end |
Instance Method Details
#call ⇒ Object
10 11 12 |
# File 'lib/ioc/dependency.rb', line 10 def call singleton ? value : value.call end |