Class: Novel::Container
- Inherits:
-
Object
- Object
- Novel::Container
- Defined in:
- lib/novel/container.rb
Instance Attribute Summary collapse
-
#_container ⇒ Object
readonly
Returns the value of attribute _container.
Instance Method Summary collapse
-
#initialize ⇒ Container
constructor
A new instance of Container.
- #register(key, object) ⇒ Object
- #resolve(key) ⇒ Object
Constructor Details
#initialize ⇒ Container
Returns a new instance of Container.
5 6 7 |
# File 'lib/novel/container.rb', line 5 def initialize @_container = {} end |
Instance Attribute Details
#_container ⇒ Object (readonly)
Returns the value of attribute _container.
3 4 5 |
# File 'lib/novel/container.rb', line 3 def _container @_container end |
Instance Method Details
#register(key, object) ⇒ Object
9 10 11 |
# File 'lib/novel/container.rb', line 9 def register(key, object) _container[key.to_s] = object end |
#resolve(key) ⇒ Object
13 14 15 |
# File 'lib/novel/container.rb', line 13 def resolve(key) _container[key.to_s] end |