Class: EideticPDF::PdfObjects::IndirectObject

Inherits:
Object
  • Object
show all
Defined in:
lib/epdfo.rb

Direct Known Subclasses

FreeXRefEntry, PdfDictionaryObject

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(seq, gen, obj = nil) ⇒ IndirectObject

Returns a new instance of IndirectObject.



52
53
54
# File 'lib/epdfo.rb', line 52

def initialize(seq, gen, obj=nil)
  @seq, @gen, @obj = seq, gen, obj
end

Instance Attribute Details

#genObject (readonly)

Returns the value of attribute gen.



50
51
52
# File 'lib/epdfo.rb', line 50

def gen
  @gen
end

#seqObject (readonly)

Returns the value of attribute seq.



50
51
52
# File 'lib/epdfo.rb', line 50

def seq
  @seq
end

Instance Method Details

#bodyObject



60
61
62
# File 'lib/epdfo.rb', line 60

def body
  @obj ? "#{@obj}\n" : ''
end


64
65
66
# File 'lib/epdfo.rb', line 64

def footer
  "endobj\n"
end

#headerObject



56
57
58
# File 'lib/epdfo.rb', line 56

def header
  "#{@seq} #{@gen} obj\n"
end

#reference_objectObject



76
77
78
# File 'lib/epdfo.rb', line 76

def reference_object
  IndirectObjectRef.new(self)
end

#reference_stringObject



72
73
74
# File 'lib/epdfo.rb', line 72

def reference_string
  "#{@seq} #{@gen} R "
end

#to_sObject



68
69
70
# File 'lib/epdfo.rb', line 68

def to_s
  header + body + footer
end