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.



333
334
335
336
337
# File 'lib/coradoc/errors.rb', line 333

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.



331
332
333
# File 'lib/coradoc/errors.rb', line 331

def chain
  @chain
end

#targetObject (readonly)

Returns the value of attribute target.



331
332
333
# File 'lib/coradoc/errors.rb', line 331

def target
  @target
end