class WCC::Contentful::CircularReferenceError

Raised when an entry contains a circular reference and cannot be represented as a flat tree.

Attributes

id[R]
stack[R]

Public Class Methods

new(stack, id) click to toggle source
Calls superclass method
# File lib/wcc/contentful/exceptions.rb, line 18
def initialize(stack, id)
  @id = id
  @stack = stack.slice(stack.index(id)..stack.length)
  super('Circular reference detected!')
end

Public Instance Methods

message() click to toggle source
Calls superclass method
# File lib/wcc/contentful/exceptions.rb, line 24
def message
  return super unless stack

  super + "\n  " \
    "#{stack.last} points to #{id} which is also it's ancestor\n  " +
    stack.join('->')
end