class PDF::Reader::Reference
An internal PDF::Reader
class that represents an indirect reference to a PDF Object
Attributes
Public Class Methods
Source
# File lib/pdf/reader/reference.rb, line 36 def initialize(id, gen) @id, @gen = id, gen end
Create a new Reference
to an object with the specified id and revision number
Public Instance Methods
Source
# File lib/pdf/reader/reference.rb, line 52 def ==(obj) return false unless obj.kind_of?(PDF::Reader::Reference) self.hash == obj.hash end
returns true if the provided object points to the same PDF Object as the current object
Also aliased as: eql?
Source
# File lib/pdf/reader/reference.rb, line 62 def hash "#{self.id}:#{self.gen}".hash end
returns a hash based on the PDF::Reference this object points to. Two different Reference
objects that point to the same PDF Object will return an identical hash
Source
# File lib/pdf/reader/reference.rb, line 41 def to_a [self] end
returns the current Reference
object in an array with a single element
Source
# File lib/pdf/reader/reference.rb, line 46 def to_i self.id end
returns the ID of this reference. Use with caution, ignores the generation id