Exception: Coradoc::CircularIncludeError

Inherits:
Error
  • Object
show all
Defined in:
lib/coradoc/errors.rb

Overview

Error raised when a cycle is detected in the include graph. The chain is the list of files leading back to the repeated target.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target:, chain:) ⇒ CircularIncludeError

Returns a new instance of CircularIncludeError.



314
315
316
317
318
# File 'lib/coradoc/errors.rb', line 314

def initialize(target:, chain:)
  @target = target
  @chain = chain
  super("Circular include detected: #{chain.join(' -> ')} -> #{target}")
end

Instance Attribute Details

#chainObject (readonly)

Returns the value of attribute chain.



312
313
314
# File 'lib/coradoc/errors.rb', line 312

def chain
  @chain
end

#targetObject (readonly)

Returns the value of attribute target.



312
313
314
# File 'lib/coradoc/errors.rb', line 312

def target
  @target
end