Class: PDF::Extract::ReferenceResolver

Inherits:
Object
  • Object
show all
Defined in:
lib/pdf/extract/reference_resolver.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document:) ⇒ ReferenceResolver

Returns a new instance of ReferenceResolver.



7
8
9
# File 'lib/pdf/extract/reference_resolver.rb', line 7

def initialize(document:)
  @objects = document.objects
end

Instance Attribute Details

#objectsObject (readonly)

Returns the value of attribute objects.



5
6
7
# File 'lib/pdf/extract/reference_resolver.rb', line 5

def objects
  @objects
end

Instance Method Details

#lookup(reference) ⇒ Object



11
12
13
14
15
# File 'lib/pdf/extract/reference_resolver.rb', line 11

def lookup(reference)
  reference.is_a?(Array) ? lookup_mutiple(reference) : lookup_single(reference)
rescue SystemStackError
  raise PDF::Extract::Error.new("map contains infinite recursion")
end