Parent

Class/Module Index [+]

Quicksearch

Origami::XRef::Subsection

Class representing a cross-reference subsection. A subsection contains a continute set of XRef.

Attributes

range[R]

Public Class Methods

new(start, entries = []) click to toggle source

Creates a new XRef subsection.

start

The number of the first object referenced in the subsection.

entries

An array of XRef.

# File lib/origami/xreftable.rb, line 143
def initialize(start, entries = [])
  
  @entries = entries.dup
  @range = Range.new(start, start + entries.size - 1)
  
end

Public Instance Methods

[](no) click to toggle source

Returns XRef associated with a given object.

no

The Object number.

# File lib/origami/xreftable.rb, line 179
def [](no)
  @entries[no - @range.begin]
end
each(&b) click to toggle source

Processes each XRef in the subsection.

# File lib/origami/xreftable.rb, line 186
def each(&b)
  @entries.each(&b)
end
has_object?(no) click to toggle source

Returns whether this subsection contains information about a particular object.

no

The Object number.

# File lib/origami/xreftable.rb, line 171
def has_object?(no)
  @range.include?(no)
end
to_s() click to toggle source

Outputs self into PDF code.

# File lib/origami/xreftable.rb, line 193
def to_s
  section = "#{@range.begin} #{@range.end - @range.begin + 1}" + EOL
  @entries.each { |xref|
    section << xref.to_s
  }
  
  section
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.