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 218
218:       def initialize(subsections = [])
219:         @subsections = subsections
220:       end

Public Instance methods

Appends a new subsection.

subsection:A XRefSubsection.

[Source]

     # File sources/parser/xreftable.rb, line 240
240:       def <<(subsection)
241:         @subsections << subsection
242:       end

Returns a XRef associated with a given object.

no:The Object number.

[Source]

     # File sources/parser/xreftable.rb, line 248
248:       def [](no)
249:         @subsections.each { |s|
250:           return s[no] if s.has_object?(no)
251:         }
252:         nil
253:       end

Processes each XRefSubsection.

[Source]

     # File sources/parser/xreftable.rb, line 260
260:       def each(&b)
261:         @subsections.each(&b)
262:       end
find(no)

Alias for #[]

Outputs self into PDF code.

[Source]

     # File sources/parser/xreftable.rb, line 267
267:       def to_s
268:         "xref" << EOL << @subsections.join
269:       end

[Validate]