class Origami::Reference
Class representing a Reference Object. Reference are like symbolic links pointing to a particular object into the file.
Constants
- REGEXP_TOKEN
Attributes
refgen[RW]
refno[RW]
Public Class Methods
native_type()
click to toggle source
# File lib/origami/reference.rb, line 112 def self.native_type ; Reference end
new(refno, refgen)
click to toggle source
# File lib/origami/reference.rb, line 45 def initialize(refno, refgen) @refno, @refgen = refno, refgen end
Public Instance Methods
<=>(ref)
click to toggle source
# File lib/origami/reference.rb, line 90 def <=>(ref) #:nodoc self.to_a <=> ref.to_a end
eql?(ref)
click to toggle source
# File lib/origami/reference.rb, line 82 def eql?(ref) #:nodoc ref.is_a?(Reference) and ref.refno == @refno and ref.refgen == @refgen end
solve()
click to toggle source
# File lib/origami/reference.rb, line 66 def solve pdfdoc = self.pdf if pdfdoc.nil? raise InvalidReferenceError, "Not attached to any PDF" end target = pdfdoc.get_object(self) if target.nil? and not Origami::OPTIONS[:ignore_bad_references] raise InvalidReferenceError, "Cannot resolve reference : #{self.to_s}" end target or Null.new end
to_a()
click to toggle source
Returns a Ruby array with the object number and the generation this reference is pointing to.
# File lib/origami/reference.rb, line 97 def to_a [@refno, @refgen] end
to_obfuscated_str()
click to toggle source
Calls superclass method
# File lib/origami/obfuscation.rb, line 165 def to_obfuscated_str refstr = refno.to_s + Obfuscator.junk_spaces + refgen.to_s + Obfuscator.junk_spaces + "R" super(refstr) end
value()
click to toggle source
Returns self.
# File lib/origami/reference.rb, line 108 def value self end