Exception: Molinillo::CircularDependencyError
- Inherits:
-
ResolverError
- Object
- StandardError
- ResolverError
- Molinillo::CircularDependencyError
- Defined in:
- lib/molinillo/errors.rb
Overview
Note:
This exception will be thrown if and only if a Vertex is added to a DependencyGraph that has a DependencyGraph::Vertex#path_to? an existing DependencyGraph::Vertex
An error caused by attempting to fulfil a dependency that was circular
Instance Attribute Summary collapse
-
#dependencies ⇒ Object
readonly
- Set<Object>
-
the dependencies responsible for causing the error.
Instance Method Summary collapse
-
#initialize(vertices) ⇒ CircularDependencyError
constructor
Initializes a new error with the given circular vertices.
Constructor Details
#initialize(vertices) ⇒ CircularDependencyError
Initializes a new error with the given circular vertices.
47 48 49 50 |
# File 'lib/molinillo/errors.rb', line 47 def initialize(vertices) super "There is a circular dependency between #{vertices.map(&:name).join(' and ')}" @dependencies = vertices.map { |vertex| vertex.payload.possibilities.last }.to_set end |
Instance Attribute Details
#dependencies ⇒ Object (readonly)
- Set<Object>
-
the dependencies responsible for causing the error
42 43 44 |
# File 'lib/molinillo/errors.rb', line 42 def dependencies @dependencies end |