Class Origami::XRef::Section
In: sources/parser/xreftable.rb
Parent: Object

Class representing a Cross-reference table. A section contains a set of XRefSubsection.

Methods

<<   []   each   find   new   to_s  

Public Class methods

Creates a new XRef section.

subsections:An array of XRefSubsection.

[Source]

     # File sources/parser/xreftable.rb, line 176
176:       def initialize(subsections = [])
177:         @subsections = subsections
178:       end

Public Instance methods

Appends a new subsection.

subsection:A XRefSubsection.

[Source]

     # File sources/parser/xreftable.rb, line 198
198:       def <<(subsection)
199:         @subsections << subsection
200:       end

Returns a XRef associated with a given object.

no:The Object number.

[Source]

     # File sources/parser/xreftable.rb, line 206
206:       def [](no)
207:         @subsections.each { |s|
208:           return s[no] if s.has_object?(no)
209:         }
210:         nil
211:       end

Processes each XRefSubsection.

[Source]

     # File sources/parser/xreftable.rb, line 218
218:       def each(&b)
219:         @subsections.each(&b)
220:       end
find(no)

Alias for #[]

Outputs self into PDF code.

[Source]

     # File sources/parser/xreftable.rb, line 225
225:       def to_s
226:         "xref" << EOL << @subsections.join
227:       end

[Validate]