Class: Novel::Container

Inherits:
Object
  • Object
show all
Defined in:
lib/novel/container.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeContainer

Returns a new instance of Container.



5
6
7
# File 'lib/novel/container.rb', line 5

def initialize
  @_container = {}
end

Instance Attribute Details

#_containerObject (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