Exception: Samvera::NestingIndexer::Exceptions::DocumentIsItsOwnAncestorError

Inherits:
CycleDetectionError show all
Defined in:
lib/samvera/nesting_indexer/exceptions.rb

Overview

Raised when we encounter a document that is to be indexed as its own ancestor.

Instance Attribute Summary collapse

Attributes inherited from CycleDetectionError

#id

Instance Method Summary collapse

Constructor Details

#initialize(id:, pathnames:) ⇒ DocumentIsItsOwnAncestorError

Returns a new instance of DocumentIsItsOwnAncestorError.



54
55
56
57
# File 'lib/samvera/nesting_indexer/exceptions.rb', line 54

def initialize(id:, pathnames:)
  super(id: id)
  @pathnames = pathnames
end

Instance Attribute Details

#pathnamesObject (readonly)

Returns the value of attribute pathnames.



53
54
55
# File 'lib/samvera/nesting_indexer/exceptions.rb', line 53

def pathnames
  @pathnames
end

Instance Method Details

#to_sObject



59
60
61
# File 'lib/samvera/nesting_indexer/exceptions.rb', line 59

def to_s
  "Document with ID=#{id.inspect} is marked as its own ancestor based on the given pathnames: #{pathnames.inspect}."
end