Exception: PgObjects::CyclicDependencyError
- Inherits:
-
StandardError
- Object
- StandardError
- PgObjects::CyclicDependencyError
- Defined in:
- lib/pg_objects.rb
Overview
Raised when object dependencies form a cycle. Carries the resolution chain
that closed the cycle (e.g. ["a", "b", "a"]) via cycle_path; the message
renders it as "a -> b -> a". Also accepts a single name for compatibility.
Instance Attribute Summary collapse
-
#cycle_path ⇒ Object
readonly
Returns the value of attribute cycle_path.
Instance Method Summary collapse
-
#initialize(cycle_path = nil) ⇒ CyclicDependencyError
constructor
A new instance of CyclicDependencyError.
Constructor Details
#initialize(cycle_path = nil) ⇒ CyclicDependencyError
Returns a new instance of CyclicDependencyError.
36 37 38 39 |
# File 'lib/pg_objects.rb', line 36 def initialize(cycle_path = nil) @cycle_path = Array(cycle_path) @cycle_path.empty? ? super() : super(@cycle_path.join(' -> ')) end |
Instance Attribute Details
#cycle_path ⇒ Object (readonly)
Returns the value of attribute cycle_path.
34 35 36 |
# File 'lib/pg_objects.rb', line 34 def cycle_path @cycle_path end |