Class: VContainer::ParentProvider
- Inherits:
-
Object
- Object
- VContainer::ParentProvider
- Defined in:
- lib/vcontainer/parent_provider.rb
Overview
A simple provider that looks up into a parent to provide something
Instance Method Summary collapse
- #build(what, container = NilContainer.new) ⇒ Object
- #can_handle?(what) ⇒ Boolean
-
#initialize(parent) ⇒ ParentProvider
constructor
A new instance of ParentProvider.
Constructor Details
#initialize(parent) ⇒ ParentProvider
Returns a new instance of ParentProvider.
6 7 8 |
# File 'lib/vcontainer/parent_provider.rb', line 6 def initialize(parent) @parent = parent end |
Instance Method Details
#build(what, container = NilContainer.new) ⇒ Object
10 11 12 |
# File 'lib/vcontainer/parent_provider.rb', line 10 def build(what, container = NilContainer.new) @parent.provide(what) end |
#can_handle?(what) ⇒ Boolean
14 15 16 |
# File 'lib/vcontainer/parent_provider.rb', line 14 def can_handle?(what) @parent.can_provide?(what) end |