   create: (id) -> @get id
 
   injectInto: (value) ->
-
     unless _.isObject(value) then return
-
     # Get flat map of dependencies (possibly inherited)
     dependencies = @_mapDependencies value
-
     # Inject into dependencies to create the object graph
     value[key] ?= @get(id) for key, id of dependencies
-
     # Notify when dependencies are ready, never call twice
     if value.onDependenciesReady? and !value.__dependenciesInjected__
       value.onDependenciesReady()
-
       if Object.defineProperty?
         # Flag this object as injected
         Object.defineProperty value, '__dependenciesInjected__',

  remove: (id) -> delete @_mappings[id]

  get: (id) ->

    # Provide nice error message if a mapping wasn't found
    if not @_mappings[id]?
      throw new Error "No mapping for identifier <#{id}> was found."

    dependency = @_mappings[id].provide()
    @injectInto dependency
    return dependency

  addProvider: (name, provider) -> @_providers[name] = provider

  _mapDependencies: (value, deps={}) ->
    Class = value.constructor ? null
    SuperClass = Class.__super__ ? null
    # Recurse down the prototype chain
    if SuperClass? then @_mapDependencies SuperClass.constructor::, deps
    # Add dependencies of current value
    deps[key] = id for key, id of value.Dependencies
    return deps

# ========= PRIVATE CLASSES ========== #
