class PDF::Reader::Reference

An internal PDF::Reader class that represents an indirect reference to a PDF Object

Attributes

gen[R]

: Integer

id[R]

: Integer

Public Class Methods

new(id, gen) click to toggle source
Create a new Reference to an object with the specified id and revision number

: (Integer, Integer) -> void

# File lib/pdf/reader/reference.rb, line 42
def initialize(id, gen)
  @id = id
  @gen = gen
end

Public Instance Methods

==(obj) click to toggle source
returns true if the provided object points to the same PDF Object as the
current object

: (Object) -> bool

# File lib/pdf/reader/reference.rb, line 62
def ==(obj)
  return false unless obj.kind_of?(PDF::Reader::Reference)

  self.hash == obj.hash
end
Also aliased as: eql?
eql?(obj)
Alias for: ==
hash() click to toggle source
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

: () -> Integer

# File lib/pdf/reader/reference.rb, line 73
def hash
  "#{self.id}:#{self.gen}".hash
end
to_a() click to toggle source
returns the current Reference object in an array with a single element

: () -> Array

# File lib/pdf/reader/reference.rb, line 49
def to_a
  [self]
end
to_i() click to toggle source
returns the ID of this reference. Use with caution, ignores the generation id

: () -> Integer

# File lib/pdf/reader/reference.rb, line 55
def to_i
  self.id
end