lib/deep_end.rb
def add_dependency(key, dependencies = [])

      raise SelfDependencyError, "An object's dependencies cannot contain itself" if dependencies.include? key

      node = node_for_key_or_new key
      dependencies.each do |dependency|
        node.addEdge(node_for_key_or_new(dependency))
      end
      resolve_dependencies
    end
def add_dependency(key, dependencies = [])

      raise SelfDependencyError, "An object's dependencies cannot contain itself" if dependencies.include? key

      node = node_for_key_or_new key
      dependencies.each do |dependency|
        node.addEdge(node_for_key_or_new(dependency))
      end
      resolve_dependencies
    end
def add_dependency ( key , dependencies = [ ] ) raise SelfDependencyError , "An object's dependencies cannot contain itself" if dependencies . include? key node = node_for_key_or_new key dependencies . each do | dependency | node . addEdge ( node_for_key_or_new ( dependency ) ) end resolve_dependencies end
Add a new node, causing dependencies to be re-evaluated
Add a new node causing dependencies to be re - evaluated