Class: PDF::Reader::Reference

### Home Classes Methods

### In Files

- lib/pdf/reader/reference.rb

### Parent

Object

### Methods

- ::new
- #==
- #eql?
- #hash
- #to_a
- #to_i

### Files

- MIT-LICENSE
- README.rdoc
- TODO
- mac_expert.txt
- mac_roman.txt
- pdf_doc.txt
- standard.txt
- symbol.txt
- win_ansi.txt
- zapf_dingbats.txt
- glyphlist.txt

### Class/Module Index

Quicksearch

- PDF
- PDF::Reader
- PDF::Reader::Buffer
- PDF::Reader::CidWidths
- PDF::Reader::EncryptedPDFError
- PDF::Reader::Filter
- PDF::Reader::Filter::Ascii85
- PDF::Reader::Filter::AsciiHex
- PDF::Reader::Filter::Depredict
- PDF::Reader::Filter::Flate
- PDF::Reader::Filter::Lzw
- PDF::Reader::Filter::Null
- PDF::Reader::Filter::RunLength
- PDF::Reader::Font
- PDF::Reader::FontDescriptor
- PDF::Reader::FormXObject
- PDF::Reader::InvalidObjectError
- PDF::Reader::MalformedPDFError
- PDF::Reader::ObjectCache
- PDF::Reader::ObjectHash
- PDF::Reader::PageLayout
- PDF::Reader::PageState
- PDF::Reader::PageTextReceiver
- PDF::Reader::Parser
- PDF::Reader::PrintReceiver
- PDF::Reader::Reference
- PDF::Reader::RegisterReceiver
- PDF::Reader::ResourceMethods
- PDF::Reader::StandardSecurityHandler
- PDF::Reader::Stream
- PDF::Reader::SynchronizedCache
- PDF::Reader::TextReceiver
- PDF::Reader::TextRun
- PDF::Reader::TransformationMatrix
- PDF::Reader::UnsupportedFeatureError
- PDF::Reader::WidthCalculator
- PDF::Reader::WidthCalculator::BuiltIn
- PDF::Reader::WidthCalculator::Composite
- PDF::Reader::WidthCalculator::TrueType
- PDF::Reader::WidthCalculator::TypeOneOrThree
- PDF::Reader::WidthCalculator::TypeZero
- PDF::Reader::XRef
- AFM
- AFM::Font

No matching classes.

# PDF::Reader::Reference

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

### Attributes

gen[R]
id[R]

### Public Class Methods

new(id, gen) click to toggle source

Create a new Reference to an object with the specified id and revision number

    # File lib/pdf/reader/reference.rb, line 34
    def initialize (id, gen)
      @id, @gen = id, 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

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

      self.hash == obj.hash
    end

Also aliased as: eql?
eql?(obj) click to toggle source
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

    # File lib/pdf/reader/reference.rb, line 60
    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

    # File lib/pdf/reader/reference.rb, line 39
    def to_a
      [self]
    end

to_i() click to toggle source

returns the ID of this reference. Use with caution, ignores the generation id

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

[Validate]

Generated with the Darkfish Rdoc Generator 2.